-
Notifications
You must be signed in to change notification settings - Fork 21
/
.eslintrc.js
103 lines (97 loc) · 3.04 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
module.exports = {
env: {
'jest/globals': true,
},
extends: 'airbnb',
globals: {
debugPage: true,
document: true,
fetch: true,
mount: true,
page: true,
render: true,
resetPage: true,
serverAddress: true,
shallow: true,
unmount: true,
window: true,
},
parser: 'babel-eslint',
plugins: [
'import',
'jest',
'jsx-a11y',
'react',
'react-hooks',
'sort-destructure-keys',
],
rules: {
'arrow-body-style': 0,
'arrow-parens': ['error', 'as-needed'],
'class-methods-use-this': 0,
'comma-dangle': ['error', {
arrays: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline',
imports: 'always-multiline',
objects: 'always-multiline',
}],
complexity: ['error', 20],
'consistent-return': 0,
'import/no-extraneous-dependencies': ['error', { devDependencies: ['stories/**'] }],
'import/prefer-default-export': 0,
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
'jsx-a11y/img-has-alt': 0,
'jsx-a11y/label-has-for': 0,
'jsx-a11y/no-static-element-interactions': 0,
'linebreak-style': 0,
'max-len': ['error', { code: 100, tabWidth: 2 }],
'max-lines': ['error', { max: 1000, skipComments: true }],
'max-statements': ['error', 40, { ignoreTopLevelFunctions: true }],
'no-case-declarations': 0,
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-continue': 0,
'no-else-return': ['error', { allowElseIf: true }],
'no-plusplus': 0,
'no-underscore-dangle': 0,
'no-unneeded-ternary': 0,
// disabled for now until babel-eslint fixes https://github.com/babel/babel-eslint/pull/785
'no-useless-rename': 0,
'no-var': 0,
'object-shorthand': 0,
'operator-assignment': 0,
'react/forbid-prop-types': 'off',
'react/jsx-boolean-value': 0,
'react/jsx-closing-tag-location': 2,
'react/jsx-curly-newline': [2, {
multiline: 'forbid',
singleline: 'forbid',
}],
'react/jsx-curly-spacing': [2, 'never'],
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/jsx-first-prop-new-line': [2, 'multiline'],
'react/jsx-indent': [2, 2, { checkAttributes: false, indentLogicalExpressions: true }],
'react/jsx-indent-props': [2, 2],
'react/jsx-key': 2,
'react/jsx-max-props-per-line': [1, { maximum: 1, when: 'always' }],
'react/jsx-no-target-blank': 0,
'react/jsx-props-no-spreading': 'off',
'react/jsx-sort-props': ['error', {
ignoreCase: true,
reservedFirst: true,
}],
'react/jsx-uses-react': 'off',
'react/no-danger': 0,
'react/prefer-stateless-function': 0,
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
// 'react-hooks/exhaustive-deps': 'warn',
'sort-destructure-keys/sort-destructure-keys': 2,
'sort-keys': ['error', 'asc', { natural: true }],
'vars-on-top': 0,
},
};