-
Notifications
You must be signed in to change notification settings - Fork 14
/
.eslintrc.extra.js
74 lines (71 loc) · 1.89 KB
/
.eslintrc.extra.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
module.exports = {
env: {
browser: true,
es6: true,
node: true,
'jest/globals': true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:jest/recommended',
],
parser: './node_modules/babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: [
'json',
'jsx-a11y',
'react',
'jest',
],
root: true,
overrides: [
{
files: ['src/tests/jest/*.js'],
// In src/setupTests.js, these globals are defined in such a way
// that they are available to all Jest tests
globals: {
React: true,
shallow: true,
},
},
],
settings: {
react: {
version: "16.4.2",
},
},
rules: {
// Errors
'eqeqeq': 'error',
'no-global-assign': 'error',
'no-redeclare': ['error', { builtinGlobals: true }],
'no-shadow': ['error', { builtinGlobals: true }],
'no-var': 'error',
'prefer-const': 'error',
'no-console': 'error',
// Stylistic warnings
'semi': ['warn', 'always'],
'comma-dangle': ['warn', {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}],
'prefer-arrow-callback': 'warn',
// Plugins
'jsx-a11y/label-has-for': ['error', {required: {every: ['id']}}],
'jsx-a11y/no-onchange': 'off',
'react/display-name': 'off',
'react/prop-types': 'off',
'react/no-unescaped-entities': ['error', {forbid: ['>', '}']}],
},
};