-
Notifications
You must be signed in to change notification settings - Fork 0
/
react.js
109 lines (109 loc) · 4.32 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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
module.exports = {
parserOptions: {
ecmaFeatures: {
jsx: true
}
},
plugins: ['react'],
rules: {
'react/boolean-prop-naming': 'error',
'react/button-has-type': 'error',
'react/default-props-match-prop-types': 'error',
'react/destructuring-assignment': 'error',
'react/display-name': 'error',
'react/forbid-component-props': 'off',
'react/forbid-dom-props': 'off',
'react/forbid-elements': 'error',
'react/forbid-foreign-prop-types': 'off',
'react/forbid-prop-types': 'error',
'react/function-component-definition': 'off',
'react/hook-use-state': 'error',
'react/iframe-missing-sandbox': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-child-element-spacing': 'error',
'react/jsx-closing-bracket-location': 'error',
'react/jsx-closing-tag-location': 'error',
'react/jsx-curly-brace-presence': 'off',
'react/jsx-curly-newline': ['error', {multiline: 'require', singleline: 'forbid'}],
'react/jsx-curly-spacing': 'error',
'react/jsx-equals-spacing': 'error',
'react/jsx-filename-extension': ['error', {extensions: ['.js']}],
'react/jsx-first-prop-new-line': 'error',
'react/jsx-fragments': 'off',
'react/jsx-handler-names': 'error',
'react/jsx-indent-props': 'off',
'react/jsx-indent': 'off',
'react/jsx-key': 'error',
'react/jsx-max-depth': 'error',
'react/jsx-max-props-per-line': 'off',
'react/jsx-newline': 'off',
'react/jsx-no-bind': 'error',
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-constructed-context-values': 'error',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-leaked-render': ['error', {validStrategies: ['ternary', 'coerce']}],
'react/jsx-no-literals': 'off',
'react/jsx-no-script-url': 'error',
'react/jsx-no-target-blank': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-no-useless-fragment': 'error',
'react/jsx-one-expression-per-line': 'error',
'react/jsx-pascal-case': 'error',
'react/jsx-props-no-multi-spaces': 'error',
'react/jsx-props-no-spreading': 'off',
'react/jsx-sort-default-props': 'error',
'react/jsx-sort-props': 'off',
'react/jsx-tag-spacing': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-wrap-multilines': 'off',
'react/no-access-state-in-setstate': 'error',
'react/no-adjacent-inline-elements': 'off', // cannot activate it, conflict with prettier
'react/no-array-index-key': 'off',
'react/no-arrow-function-lifecycle': 'error',
'react/no-children-prop': 'error',
'react/no-danger-with-children': 'error',
'react/no-danger': 'error',
'react/no-deprecated': 'error',
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-find-dom-node': 'error',
'react/no-invalid-html-attribute': 'off',
'react/no-is-mounted': 'error',
'react/no-multi-comp': 'off',
'react/no-namespace': 'error',
'react/no-object-type-as-default-prop': 'off',
'react/no-redundant-should-component-update': 'error',
'react/no-render-return-value': 'error',
'react/no-set-state': 'off',
'react/no-string-refs': 'error',
'react/no-this-in-sfc': 'error',
'react/no-typos': 'off',
'react/no-unescaped-entities': 'error',
'react/no-unknown-property': 'error',
'react/no-unsafe': 'error',
'react/no-unstable-nested-components': 'error',
'react/no-unused-class-component-methods': 'error',
'react/no-unused-prop-types': 'error',
'react/no-unused-state': 'error',
'react/no-will-update-set-state': 'error',
'react/prefer-es6-class': 'error',
'react/prefer-exact-props': 'error',
'react/prefer-read-only-props': 'off',
'react/prefer-stateless-function': 'error',
'react/prop-types': 'error',
'react/react-in-jsx-scope': 'error',
'react/require-default-props': 'off',
'react/require-optimization': 'off',
'react/require-render-return': 'error',
'react/self-closing-comp': 'error',
'react/sort-comp': 'error',
'react/sort-default-props': 'error',
'react/sort-prop-types': 'off',
'react/state-in-constructor': ['error', 'always'],
'react/static-property-placement': 'error',
'react/style-prop-object': 'error',
'react/void-dom-elements-no-children': 'error'
}
};