-
Notifications
You must be signed in to change notification settings - Fork 40
/
.eslintrc.js
72 lines (71 loc) · 1.58 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
const a11yOff = Object.keys(require('eslint-plugin-jsx-a11y').rules).reduce(
(acc, rule) => {
acc[`jsx-a11y/${rule}`] = 'off';
return acc;
},
{},
);
module.exports = {
env: {
webextensions: true,
browser: true,
node: true,
es2021: true,
},
globals: {
INPAGE_SCRIPT: 'readonly',
},
extends: ['plugin:react/recommended', 'airbnb'],
parser: '@babel/eslint-parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2022,
sourceType: 'module',
},
plugins: ['react'],
rules: {
...a11yOff,
'react/react-in-jsx-scope': 'off',
'import/no-extraneous-dependencies': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/jsx-props-no-spreading': 'off',
'no-nested-ternary': 'off',
'no-await-in-loop': 'off',
'no-restricted-syntax': 'off',
'no-param-reassign': ['error', {
props: true,
ignorePropertyModificationsFor: [
'state',
]
}],
},
settings: {
'import/resolver': {
alias: {
map: [
['@components', './source/components'],
['@modules', './source/Modules'],
['@assets', './source/assets'],
['@shared', './source/shared'],
['@hooks', './source/hooks'],
['@redux', './source/redux'],
['@background', './source/Background'],
],
},
},
},
overrides: [
{
files: [
'**/*.test.js',
'**/*.test.jsx',
],
env: {
jest: true,
},
},
],
};