-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
52 lines (50 loc) · 1.12 KB
/
.eslintrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const isProd = process.env.NODE_ENV === 'production';
const path = require('path');
module.exports = {
env: {
browser: true,
node: true,
},
extends: [
'airbnb-base',
],
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
},
rules: {
// tabs not spaces
indent: ['error', 'tab', { SwitchCase: 1 }],
'no-tabs': 'off',
// allow debugger during development
'no-debugger': isProd ? 'error' : 'off',
// allow console during development
'no-console': isProd ? ['warn', { allow: ['error'] }] : 'off',
// max line length 120
'max-len': ['error', { code: 120, ignoreComments: true }],
// allow no return statement
'consistent-return': 'off',
// allow curly brackets around arrow function bodies
'arrow-body-style': 'off',
},
overrides: [
{
files: ['*.stories.*', '*.spec.*'],
rules: {
// disable max length errors for stories and tests
'max-len': 'off',
},
},
],
settings: {
'import/resolver': {
alias: {
map: [
['~/node_modules', path.resolve(__dirname, './node_modules/')],
],
extensions: ['.ts', '.js', '.json'],
},
},
},
root: true,
};