-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreact.js
40 lines (39 loc) · 1.22 KB
/
react.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
module.exports = {
rules: {
// React
'react/display-name': 'warn',
'react/no-deprecated': 'warn',
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-is-mounted': 'error',
'react/no-string-refs': 'error',
'react/no-unknown-property': 'warn',
'react/prefer-es6-class': 'warn',
'react/prefer-stateless-function': 'warn',
'react/prop-types': 'error',
'react/react-in-jsx-scope': 2,
'react/require-render-return': 'error',
'react/self-closing-comp': 'warn',
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
// React/JSX
'react/jsx-boolean-value': ['warn', 'always'],
'react/jsx-equals-spacing': 'error',
'react/jsx-indent': ['warn', 2],
'react/jsx-key': 'warn',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-undef': ['error', { allowGlobals: true }],
'react/jsx-pascal-case': 'warn',
'react/jsx-tag-spacing': ['warn', {
beforeSelfClosing: 'always',
}],
'react/jsx-uses-react': 2,
'react/jsx-uses-vars': 2,
'react/jsx-wrap-multilines': 'warn',
},
plugins: [
'react',
'react-hooks',
],
};