-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc.js
66 lines (65 loc) · 1.59 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
const reactAppConfig = require('eslint-config-react-app');
const prettierIndexConfig = require('eslint-config-prettier');
/**
* ~ rules
* "off" or 0 - turn the rule off
* "warn" or 1 - turn the rule on as a warning (doesn’t affect exit code)
* "error" or 2 - turn the rule on as an error (exit code will be 1)
*/
module.exports = {
extends: ['egg'],
...reactAppConfig,
rules: {
...reactAppConfig.rules,
strict: [0],
'no-sequences': [0],
'no-mixed-operators': [0],
'react/react-in-jsx-scope': [0],
'no-useless-escape': [0],
indent: ['error', 2, { SwitchCase: 1 }],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
'jsx-quotes': ['error', 'prefer-double'],
semi: 'off',
'array-bracket-spacing': 'off',
'max-len': [
'error',
100,
{
comments: 100,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'no-nested-ternary': ['error'],
'no-debugger': ['error'],
'no-console': [
'error',
{
allow: ['warn'],
},
],
'no-shadow': ['warn'],
'prefer-promise-reject-errors': [
'warn',
{
allowEmptyReject: true,
},
],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-key': 'error',
...prettierIndexConfig.rules,
},
globals: {
__root__dirname: true,
Cookies: true,
fetchMock: true,
mockStore: true,
initStore: true,
},
};