-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.extra.js
68 lines (64 loc) · 1.8 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
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: '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,
},
},
],
rules: {
// Errors
'eqeqeq': 'error',
'no-global-assign': 'error',
'no-redeclare': ['error', {builtinGlobals: true}],
'no-shadow': ['error', {builtinGlobals: true}],
'no-var': 'error',
'prefer-const': 'error',
'semi': ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
// Warnings
'prefer-arrow-callback': 'warn',
'no-console': '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: ['>', '}']}],
// Temporarily work around this bug:
// https://github.com/evcohen/eslint-plugin-jsx-a11y/pull/437
'jsx-a11y/heading-has-content': 'off',
'jsx-a11y/anchor-has-content': 'off',
},
};