/
.eslintrc.yml
87 lines (79 loc) 路 2.16 KB
/
.eslintrc.yml
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
parser: 'babel-eslint'
globals:
PRODUCTION: false
FileReader: false
ecmaFeatures:
modules: true
jsx: true
parserOptions:
ecmaFeatures:
jsx: true
env:
browser: true
es6: true
jest: true
node: true
plugins: ['react', 'prettier', 'react-hooks']
rules:
camelcase: [2, { 'properties': 'never' }]
curly: [2, 'multi-line']
dot-notation: 0
eqeqeq: [2, 'allow-null']
guard-for-in: 2
no-bitwise: 2
no-dupe-keys: 2
no-shadow: 2
no-undef: 2
no-underscore-dangle: 0
no-unused-vars:
[
1,
{
vars: 'all',
args: 'none',
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
},
]
no-use-before-define: [2, 'nofunc']
no-var: 2
strict: [2, 'never']
wrap-iife: [2, 'inside']
#================================
# eslint-plugin-prettier
#================================
prettier/prettier:
[
'error',
{
'singleQuote': true,
'trailingComma': 'all',
'semi': false,
'tabWidth': 4,
},
]
#====================================
# eslint-plugin-react
#------------------------------------
react/jsx-boolean-value: [1, 'never']
react/jsx-no-duplicate-props: [2, { ignoreCase: true }]
react/jsx-no-undef: 1
react/jsx-uses-react: 1
react/jsx-uses-vars: 1
react/no-array-index-key: 2
react/no-did-mount-set-state: 2
react/no-did-update-set-state: 2
react/no-multi-comp: 1
react/no-string-refs: 2
react/no-unknown-property: 1
react/no-unused-prop-types:
[2, { customValidators: [], skipShapeProps: true }]
# react/prefer-es6-class: 2 # implement ASAP, after code conversion
react/prop-types: [2, { ignore: ['nion'], customValidators: [] }]
react/react-in-jsx-scope: 1
react/require-render-return: 2
react/self-closing-comp: 1
react/jsx-wrap-multilines:
['error', { 'declaration': false, 'assignment': false }]
react-hooks/rules-of-hooks: 'error'
react-hooks/exhaustive-deps: 'error'