-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreact.js
58 lines (52 loc) · 1.49 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
48
49
50
51
52
53
54
55
56
57
58
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import planetConfig from './index.js';
export default [
...planetConfig,
{
name: 'planet/react',
plugins: {
react,
'react-hooks': reactHooks,
},
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
settings: {
react: {
version: 'detect',
},
},
files: ['**/*.js', '**/*.jsx'],
rules: {
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-curly-brace-presence': 'error',
'react/jsx-key': 'error',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-sort-props': 'off',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/no-array-index-key': 'error',
'react/no-children-prop': 'error',
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-unescaped-entities': 'error',
'react/no-unknown-property': 'error',
'react/no-unused-prop-types': 'error',
'react/no-will-update-set-state': 'error',
'react/prop-types': 'error',
'react/react-in-jsx-scope': 'error',
'react/sort-prop-types': 'off',
},
},
];