-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
82 lines (78 loc) · 2.25 KB
/
.eslintrc.js
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
DISABLE_ESLINT_PLUGIN = true;
ESLINT_NO_DEV_ERRORS = true;
// Disable all a11y rules
const a11y = require('eslint-plugin-jsx-a11y');
const a11yOff = Object.keys(a11y.rules).reduce((acc, rule) => {
acc[`jsx-a11y/${rule}`] = 'off';
return acc;
}, {});
module.exports = {
env: {
browser: true,
es6: true
},
extends: ['plugin:react/recommended', 'airbnb'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2021
},
plugins: ['react', 'react-hooks'],
settings: {
'import/resolver': {
alias: {
map: [['@', './src']]
}
}
},
rules: {
'import/extensions': 0,
'linebreak-style': 0,
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-tabs': 0,
indent: ['warn', 'tab', { SwitchCase: 1 }],
'comma-dangle': 0,
'arrow-parens': 0,
'object-curly-newline': [
'warn',
{
ImportDeclaration: { minProperties: 6, consistent: false, multiline: true }
}
],
radix: 0,
camelcase: ['warn', { ignoreDestructuring: true, properties: 'never' }],
'arrow-body-style': ['warn', 'as-needed'],
'no-param-reassign': 0,
'no-underscore-dangle': 0,
'no-unused-vars': ['warn', { vars: 'all', args: 'after-used', ignoreRestSiblings: false }],
'no-use-before-define': ['warn'],
'no-shadow': ['warn'],
'consistent-return': ['warn'],
'operator-linebreak': ['off'],
'import/no-extraneous-dependencies': ['warn'],
'prefer-template': ['warn'],
'object-shorthand': ['warn'],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
'react/self-closing-comp': ['warn'],
'react/jsx-indent': [2, 'tab'],
'react/jsx-indent-props': [2, 'tab'],
'react/prop-types': ['off'],
'react/jsx-props-no-spreading': ['warn'],
'react/destructuring-assignment': ['warn'],
'react/jsx-one-expression-per-line': ['warn'],
'react/function-component-definition': ['warn'],
'react/jsx-no-constructed-context-values': ['warn'],
'prefer-regex-literals': ['warn'],
'react/no-array-index-key': ['off'],
'react/react-in-jsx-scope': 0,
'react/jsx-uses-react': 0,
...a11yOff
}
};