-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreact.js
47 lines (42 loc) · 1.27 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
41
42
43
44
45
46
47
const ERROR = 'error';
const WARN = 'warn';
module.exports = {
extends: './es.js',
plugins: ['react', 'react-hooks'],
settings: {
react: {
// Override this option in your own .eslintrc.json file, if needed.
version: 'latest'
}
},
rules: {
//
// ESLint Plugin React
// https://github.com/yannickcr/eslint-plugin-react
//
'react/void-dom-elements-no-children': ERROR,
'react/require-render-return': ERROR,
'react/react-in-jsx-scope': ERROR,
'react/jsx-uses-react': ERROR,
'react/jsx-no-undef': ERROR,
'react/no-typos': ERROR,
'react/forbid-foreign-prop-types': [WARN, { allowInPropTypes: true }],
'react/jsx-no-comment-textnodes': WARN,
'react/no-direct-mutation-state': WARN,
'react/no-danger-with-children': WARN,
'react/jsx-no-duplicate-props': WARN,
'react/jsx-no-target-blank': WARN,
'react/style-prop-object': WARN,
'react/self-closing-comp': WARN,
'react/jsx-pascal-case': WARN,
'react/jsx-uses-vars': WARN,
'react/no-is-mounted': WARN,
'react/jsx-key': [WARN, { checkFragmentShorthand: true }],
//
// ESLint Plugin React Hooks
// https://github.com/facebook/react
//
'react-hooks/rules-of-hooks': ERROR,
'react-hooks/exhaustive-deps': WARN
}
};