@newsteam/eslint-config 1.2.15 → 1.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -52
- package/dist/plugins/sort-react-dependency-arrays.d.ts +3 -2
- package/dist/plugins/sort-react-dependency-arrays.d.ts.map +1 -1
- package/dist/plugins/sort-react-dependency-arrays.js +95 -18
- package/dist/rules/array-function.d.ts +3 -0
- package/dist/rules/array-function.d.ts.map +1 -0
- package/dist/rules/array-function.js +56 -0
- package/dist/rules/css-modules.d.ts +3 -0
- package/dist/rules/css-modules.d.ts.map +1 -0
- package/dist/rules/css-modules.js +27 -0
- package/dist/rules/destructuring.d.ts +3 -0
- package/dist/rules/destructuring.d.ts.map +1 -0
- package/dist/rules/destructuring.js +39 -0
- package/dist/rules/eslint-comments.d.ts +3 -0
- package/dist/rules/eslint-comments.d.ts.map +1 -0
- package/dist/rules/eslint-comments.js +77 -0
- package/dist/rules/import-newlines.d.ts +3 -0
- package/dist/rules/import-newlines.d.ts.map +1 -0
- package/dist/rules/import-newlines.js +26 -0
- package/dist/rules/import-x.d.ts +3 -0
- package/dist/rules/import-x.d.ts.map +1 -0
- package/dist/rules/import-x.js +420 -0
- package/dist/{rules.d.ts → rules/index.d.ts} +1 -1
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/{rules.js → rules/index.js} +51 -1
- package/dist/rules/next.d.ts +3 -0
- package/dist/rules/next.d.ts.map +1 -0
- package/dist/rules/next.js +140 -0
- package/dist/rules/no-unsanitized.d.ts +3 -0
- package/dist/rules/no-unsanitized.d.ts.map +1 -0
- package/dist/rules/no-unsanitized.js +38 -0
- package/dist/rules/no-useless-assign.d.ts +3 -0
- package/dist/rules/no-useless-assign.d.ts.map +1 -0
- package/dist/rules/no-useless-assign.js +20 -0
- package/dist/rules/node.d.ts +3 -0
- package/dist/rules/node.d.ts.map +1 -0
- package/dist/rules/node.js +305 -0
- package/dist/rules/perfectionist.d.ts +3 -0
- package/dist/rules/perfectionist.d.ts.map +1 -0
- package/dist/rules/perfectionist.js +94 -0
- package/dist/rules/promise.d.ts +3 -0
- package/dist/rules/promise.d.ts.map +1 -0
- package/dist/rules/promise.js +123 -0
- package/dist/rules/react-19-upgrade.d.ts +3 -0
- package/dist/rules/react-19-upgrade.d.ts.map +1 -0
- package/dist/rules/react-19-upgrade.js +20 -0
- package/dist/rules/react-compiler.d.ts +3 -0
- package/dist/rules/react-compiler.d.ts.map +1 -0
- package/dist/{plugins → rules}/react-compiler.js +7 -9
- package/dist/rules/react-hooks.d.ts +3 -0
- package/dist/rules/react-hooks.d.ts.map +1 -0
- package/dist/rules/react-hooks.js +163 -0
- package/dist/rules/react-perf.d.ts +3 -0
- package/dist/rules/react-perf.d.ts.map +1 -0
- package/dist/rules/react-perf.js +47 -0
- package/dist/rules/react-refresh.d.ts +3 -0
- package/dist/rules/react-refresh.d.ts.map +1 -0
- package/dist/rules/react-refresh.js +19 -0
- package/dist/rules/react.d.ts +3 -0
- package/dist/rules/react.d.ts.map +1 -0
- package/dist/rules/react.js +740 -0
- package/dist/rules/security.d.ts +3 -0
- package/dist/rules/security.d.ts.map +1 -0
- package/dist/rules/security.js +112 -0
- package/dist/rules/sort-react-dependency-arrays.d.ts +3 -0
- package/dist/rules/sort-react-dependency-arrays.d.ts.map +1 -0
- package/dist/rules/sort-react-dependency-arrays.js +12 -0
- package/dist/rules/stylistic.d.ts +3 -0
- package/dist/rules/stylistic.d.ts.map +1 -0
- package/dist/rules/stylistic.js +916 -0
- package/dist/rules/typescript.d.ts +3 -0
- package/dist/rules/typescript.d.ts.map +1 -0
- package/dist/{plugins → rules}/typescript.js +2 -1
- package/dist/rules/unicorn.d.ts +3 -0
- package/dist/rules/unicorn.d.ts.map +1 -0
- package/dist/rules/unicorn.js +998 -0
- package/dist/test/index.d.ts +2 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +15 -0
- package/package.json +11 -13
- package/dist/plugins/array-function.d.ts +0 -3
- package/dist/plugins/array-function.d.ts.map +0 -1
- package/dist/plugins/array-function.js +0 -58
- package/dist/plugins/css-modules.d.ts +0 -3
- package/dist/plugins/css-modules.d.ts.map +0 -1
- package/dist/plugins/css-modules.js +0 -19
- package/dist/plugins/destructuring.d.ts +0 -3
- package/dist/plugins/destructuring.d.ts.map +0 -1
- package/dist/plugins/destructuring.js +0 -41
- package/dist/plugins/eslint-comments.d.ts +0 -3
- package/dist/plugins/eslint-comments.d.ts.map +0 -1
- package/dist/plugins/eslint-comments.js +0 -79
- package/dist/plugins/import-newlines.d.ts +0 -3
- package/dist/plugins/import-newlines.d.ts.map +0 -1
- package/dist/plugins/import-newlines.js +0 -28
- package/dist/plugins/import-x.d.ts +0 -3
- package/dist/plugins/import-x.d.ts.map +0 -1
- package/dist/plugins/import-x.js +0 -418
- package/dist/plugins/newline-destructuring.d.ts +0 -3
- package/dist/plugins/newline-destructuring.d.ts.map +0 -1
- package/dist/plugins/newline-destructuring.js +0 -26
- package/dist/plugins/next.d.ts +0 -3
- package/dist/plugins/next.d.ts.map +0 -1
- package/dist/plugins/next.js +0 -142
- package/dist/plugins/no-unsanitized.d.ts +0 -3
- package/dist/plugins/no-unsanitized.d.ts.map +0 -1
- package/dist/plugins/no-unsanitized.js +0 -40
- package/dist/plugins/no-useless-assign.d.ts +0 -3
- package/dist/plugins/no-useless-assign.d.ts.map +0 -1
- package/dist/plugins/no-useless-assign.js +0 -22
- package/dist/plugins/node.d.ts +0 -3
- package/dist/plugins/node.d.ts.map +0 -1
- package/dist/plugins/node.js +0 -307
- package/dist/plugins/perfectionist.d.ts +0 -3
- package/dist/plugins/perfectionist.d.ts.map +0 -1
- package/dist/plugins/perfectionist.js +0 -96
- package/dist/plugins/promise.d.ts +0 -3
- package/dist/plugins/promise.d.ts.map +0 -1
- package/dist/plugins/promise.js +0 -125
- package/dist/plugins/react-19-upgrade.d.ts +0 -3
- package/dist/plugins/react-19-upgrade.d.ts.map +0 -1
- package/dist/plugins/react-19-upgrade.js +0 -22
- package/dist/plugins/react-compiler.d.ts +0 -3
- package/dist/plugins/react-compiler.d.ts.map +0 -1
- package/dist/plugins/react-hooks.d.ts +0 -3
- package/dist/plugins/react-hooks.d.ts.map +0 -1
- package/dist/plugins/react-hooks.js +0 -165
- package/dist/plugins/react-perf.d.ts +0 -3
- package/dist/plugins/react-perf.d.ts.map +0 -1
- package/dist/plugins/react-perf.js +0 -49
- package/dist/plugins/react-refresh.d.ts +0 -3
- package/dist/plugins/react-refresh.d.ts.map +0 -1
- package/dist/plugins/react-refresh.js +0 -21
- package/dist/plugins/react.d.ts +0 -3
- package/dist/plugins/react.d.ts.map +0 -1
- package/dist/plugins/react.js +0 -738
- package/dist/plugins/security.d.ts +0 -3
- package/dist/plugins/security.d.ts.map +0 -1
- package/dist/plugins/security.js +0 -114
- package/dist/plugins/stylistic.d.ts +0 -3
- package/dist/plugins/stylistic.d.ts.map +0 -1
- package/dist/plugins/stylistic.js +0 -901
- package/dist/plugins/typescript.d.ts +0 -3
- package/dist/plugins/typescript.d.ts.map +0 -1
- package/dist/plugins/unicorn.d.ts +0 -3
- package/dist/plugins/unicorn.d.ts.map +0 -1
- package/dist/plugins/unicorn.js +0 -994
- package/dist/rules.d.ts.map +0 -1
|
@@ -0,0 +1,740 @@
|
|
|
1
|
+
import react from "eslint-plugin-react";
|
|
2
|
+
/*
|
|
3
|
+
* React specific linting rules for ESLint
|
|
4
|
+
*
|
|
5
|
+
* https://github.com/yannickcr/eslint-plugin-react
|
|
6
|
+
*/
|
|
7
|
+
export const reactPluginConfig = {
|
|
8
|
+
plugins: {
|
|
9
|
+
react,
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
/*
|
|
13
|
+
* Enforces consistent naming for boolean props
|
|
14
|
+
*
|
|
15
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/boolean-prop-naming.md
|
|
16
|
+
*/
|
|
17
|
+
"react/boolean-prop-naming": "warn",
|
|
18
|
+
/*
|
|
19
|
+
* Forbid "button" element without an explicit "type" attribute
|
|
20
|
+
*
|
|
21
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
|
|
22
|
+
*/
|
|
23
|
+
"react/button-has-type": "warn",
|
|
24
|
+
/*
|
|
25
|
+
* Enforce using onChange or readonly attribute when checked is used
|
|
26
|
+
*
|
|
27
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/checked-requires-onchange-or-readonly.md
|
|
28
|
+
*/
|
|
29
|
+
"react/checked-requires-onchange-or-readonly": "warn",
|
|
30
|
+
/*
|
|
31
|
+
* Prevent extraneous defaultProps on components
|
|
32
|
+
*
|
|
33
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/default-props-match-prop-types.md
|
|
34
|
+
*/
|
|
35
|
+
"react/default-props-match-prop-types": "warn",
|
|
36
|
+
/*
|
|
37
|
+
* Rule enforces consistent usage of destructuring assignment in component
|
|
38
|
+
*
|
|
39
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
|
|
40
|
+
*/
|
|
41
|
+
"react/destructuring-assignment": [
|
|
42
|
+
"warn",
|
|
43
|
+
"always",
|
|
44
|
+
{
|
|
45
|
+
destructureInSignature: "ignore",
|
|
46
|
+
ignoreClassFields: true,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
/*
|
|
50
|
+
* Prevent missing displayName in a React component definition
|
|
51
|
+
*
|
|
52
|
+
* Anoying to use with React.memo()
|
|
53
|
+
*
|
|
54
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md
|
|
55
|
+
*/
|
|
56
|
+
"react/display-name": "off",
|
|
57
|
+
/*
|
|
58
|
+
* Forbid certain props on Components
|
|
59
|
+
*
|
|
60
|
+
* Can't think of anything to ban right now, leaving this off
|
|
61
|
+
*
|
|
62
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md
|
|
63
|
+
*/
|
|
64
|
+
"react/forbid-component-props": "off",
|
|
65
|
+
/*
|
|
66
|
+
* Forbid certain props on DOM Nodes
|
|
67
|
+
*
|
|
68
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-dom-props.md
|
|
69
|
+
*/
|
|
70
|
+
"react/forbid-dom-props": "warn",
|
|
71
|
+
/*
|
|
72
|
+
* Forbid certain elements
|
|
73
|
+
*
|
|
74
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-elements.md
|
|
75
|
+
*/
|
|
76
|
+
"react/forbid-elements": "warn",
|
|
77
|
+
/*
|
|
78
|
+
* Forbid foreign propTypes
|
|
79
|
+
*
|
|
80
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md
|
|
81
|
+
*/
|
|
82
|
+
"react/forbid-foreign-prop-types": "warn",
|
|
83
|
+
/*
|
|
84
|
+
* Forbid certain propTypes
|
|
85
|
+
*
|
|
86
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md
|
|
87
|
+
*/
|
|
88
|
+
"react/forbid-prop-types": "warn",
|
|
89
|
+
/*
|
|
90
|
+
* Require all forwardRef components include a ref parameter
|
|
91
|
+
*
|
|
92
|
+
* Broken in eslint 10
|
|
93
|
+
*
|
|
94
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forward-ref-uses-ref.md
|
|
95
|
+
*/
|
|
96
|
+
"react/forward-ref-uses-ref": "off",
|
|
97
|
+
/*
|
|
98
|
+
* Enforce a specific function type for function components
|
|
99
|
+
*
|
|
100
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
|
|
101
|
+
*/
|
|
102
|
+
"react/function-component-definition": [
|
|
103
|
+
"warn",
|
|
104
|
+
{
|
|
105
|
+
namedComponents: "arrow-function",
|
|
106
|
+
unnamedComponents: "arrow-function",
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
/*
|
|
110
|
+
* Ensure destructuring and symmetric naming of useState hook value and setter variables
|
|
111
|
+
*
|
|
112
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md
|
|
113
|
+
*/
|
|
114
|
+
"react/hook-use-state": "warn",
|
|
115
|
+
/*
|
|
116
|
+
* Enforce sandbox attribute on iframe elements
|
|
117
|
+
*
|
|
118
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/iframe-missing-sandbox.md
|
|
119
|
+
*/
|
|
120
|
+
"react/iframe-missing-sandbox": "warn",
|
|
121
|
+
/*
|
|
122
|
+
* Enforce boolean attributes notation in JSX (fixable)
|
|
123
|
+
*
|
|
124
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
|
|
125
|
+
*/
|
|
126
|
+
"react/jsx-boolean-value": "warn",
|
|
127
|
+
/*
|
|
128
|
+
* Enforce or disallow spaces inside of curly braces in JSX attributes and expressions.
|
|
129
|
+
*
|
|
130
|
+
* Handled by @stylistic
|
|
131
|
+
*
|
|
132
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
|
|
133
|
+
*/
|
|
134
|
+
"react/jsx-child-element-spacing": "off",
|
|
135
|
+
/*
|
|
136
|
+
* Validate closing bracket location in JSX (fixable)
|
|
137
|
+
*
|
|
138
|
+
* Handled by @stylistic
|
|
139
|
+
*
|
|
140
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
|
|
141
|
+
*/
|
|
142
|
+
"react/jsx-closing-bracket-location": "off",
|
|
143
|
+
/*
|
|
144
|
+
* Validate closing tag location in JSX (fixable)
|
|
145
|
+
*
|
|
146
|
+
* Handled by @stylistic
|
|
147
|
+
*
|
|
148
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
|
|
149
|
+
*/
|
|
150
|
+
"react/jsx-closing-tag-location": "off",
|
|
151
|
+
/*
|
|
152
|
+
* Enforce curly braces or disallow unnecessary curly braces in JSX
|
|
153
|
+
*
|
|
154
|
+
* Handled by @stylistic
|
|
155
|
+
*
|
|
156
|
+
* This conflicts with react/jsx-no-literals. Leaving off for now.
|
|
157
|
+
*
|
|
158
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
|
|
159
|
+
*/
|
|
160
|
+
"react/jsx-curly-brace-presence": "off",
|
|
161
|
+
/*
|
|
162
|
+
* Enforce linebreaks in curly braces in JSX attributes and expressions. (fixable)
|
|
163
|
+
*
|
|
164
|
+
* Handled by @stylistic
|
|
165
|
+
*
|
|
166
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
|
|
167
|
+
*/
|
|
168
|
+
"react/jsx-curly-newline": ["off", "consistent"],
|
|
169
|
+
/*
|
|
170
|
+
* Enforce or disallow spaces inside of curly braces in JSX attributes and expressions (fixable)
|
|
171
|
+
*
|
|
172
|
+
* Handled by @stylistic
|
|
173
|
+
*
|
|
174
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
|
|
175
|
+
*/
|
|
176
|
+
"react/jsx-curly-spacing": [
|
|
177
|
+
"off",
|
|
178
|
+
{
|
|
179
|
+
children: { when: "always" },
|
|
180
|
+
when: "always",
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
/*
|
|
184
|
+
* Enforce or disallow spaces around equal signs in JSX attributes (fixable)
|
|
185
|
+
*
|
|
186
|
+
* Handled by @stylistic
|
|
187
|
+
*
|
|
188
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
|
|
189
|
+
*/
|
|
190
|
+
"react/jsx-equals-spacing": "off",
|
|
191
|
+
/*
|
|
192
|
+
* Restrict file extensions that may contain JSX
|
|
193
|
+
*
|
|
194
|
+
* Broken in eslint 10
|
|
195
|
+
*
|
|
196
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
|
|
197
|
+
*/
|
|
198
|
+
"react/jsx-filename-extension": [
|
|
199
|
+
"off",
|
|
200
|
+
{
|
|
201
|
+
extensions: [
|
|
202
|
+
".js",
|
|
203
|
+
".jsx",
|
|
204
|
+
".ts",
|
|
205
|
+
".tsx",
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
/*
|
|
210
|
+
* Enforce position of the first prop in JSX (fixable)
|
|
211
|
+
*
|
|
212
|
+
* Handled by @stylistic
|
|
213
|
+
*
|
|
214
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
|
|
215
|
+
*/
|
|
216
|
+
"react/jsx-first-prop-new-line": "off",
|
|
217
|
+
/*
|
|
218
|
+
* Enforce shorthand or standard form for React fragments
|
|
219
|
+
*
|
|
220
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
|
|
221
|
+
*/
|
|
222
|
+
"react/jsx-fragments": [
|
|
223
|
+
"warn",
|
|
224
|
+
"syntax",
|
|
225
|
+
],
|
|
226
|
+
/*
|
|
227
|
+
* Enforce event handler naming conventions in JSX
|
|
228
|
+
*
|
|
229
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
|
|
230
|
+
*/
|
|
231
|
+
"react/jsx-handler-names": "warn",
|
|
232
|
+
/*
|
|
233
|
+
* Validate JSX indentation (fixable)
|
|
234
|
+
*
|
|
235
|
+
* Handled by @stylistic
|
|
236
|
+
*
|
|
237
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
|
|
238
|
+
*/
|
|
239
|
+
"react/jsx-indent": "off",
|
|
240
|
+
/*
|
|
241
|
+
* Validate props indentation in JSX (fixable)
|
|
242
|
+
*
|
|
243
|
+
* Handled by @stylistic
|
|
244
|
+
*
|
|
245
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
|
|
246
|
+
*/
|
|
247
|
+
"react/jsx-indent-props": "off",
|
|
248
|
+
/*
|
|
249
|
+
* Validate JSX has key prop when in array or iterator
|
|
250
|
+
*
|
|
251
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
|
|
252
|
+
*/
|
|
253
|
+
"react/jsx-key": "warn",
|
|
254
|
+
/*
|
|
255
|
+
* Validate JSX maximum depth
|
|
256
|
+
*
|
|
257
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-depth.md
|
|
258
|
+
*/
|
|
259
|
+
"react/jsx-max-depth": [
|
|
260
|
+
"warn",
|
|
261
|
+
{
|
|
262
|
+
max: 10,
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
/*
|
|
266
|
+
* Limit maximum of props on a single line in JSX (fixable)
|
|
267
|
+
*
|
|
268
|
+
* Handled by @stylistic
|
|
269
|
+
*
|
|
270
|
+
* This is off for now because it causes --fix to get into a fight with
|
|
271
|
+
* 'react/jsx-indent', causing an infinite loop of fixing
|
|
272
|
+
*
|
|
273
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md
|
|
274
|
+
*/
|
|
275
|
+
"react/jsx-max-props-per-line": "off",
|
|
276
|
+
/*
|
|
277
|
+
* Enforce a new line after jsx elements and expressions (fixable)
|
|
278
|
+
*
|
|
279
|
+
* Handled by @stylistic
|
|
280
|
+
*
|
|
281
|
+
* This is off for now because it this would make too much empty space
|
|
282
|
+
*
|
|
283
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md
|
|
284
|
+
*/
|
|
285
|
+
"react/jsx-newline": "off",
|
|
286
|
+
/*
|
|
287
|
+
* Prevent usage of .bind() and arrow functions in JSX props
|
|
288
|
+
*
|
|
289
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
|
|
290
|
+
*/
|
|
291
|
+
"react/jsx-no-bind": "warn",
|
|
292
|
+
/*
|
|
293
|
+
* Prevent comments from being inserted as text nodes
|
|
294
|
+
*
|
|
295
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
|
|
296
|
+
*/
|
|
297
|
+
"react/jsx-no-comment-textnodes": "warn",
|
|
298
|
+
/*
|
|
299
|
+
* Prevent react contexts from taking non-stable values
|
|
300
|
+
*
|
|
301
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md
|
|
302
|
+
*/
|
|
303
|
+
"react/jsx-no-constructed-context-values": "warn",
|
|
304
|
+
/*
|
|
305
|
+
* Prevent duplicate props in JSX
|
|
306
|
+
*
|
|
307
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
|
|
308
|
+
*/
|
|
309
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
310
|
+
/*
|
|
311
|
+
* Prevent problematic leaked values from being rendered
|
|
312
|
+
*
|
|
313
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
|
|
314
|
+
*/
|
|
315
|
+
"react/jsx-no-leaked-render": "warn",
|
|
316
|
+
/*
|
|
317
|
+
* Prevent usage of unwrapped JSX strings
|
|
318
|
+
*
|
|
319
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
|
|
320
|
+
*/
|
|
321
|
+
"react/jsx-no-literals": "warn",
|
|
322
|
+
/*
|
|
323
|
+
* Prevent usage of javascript: URLs
|
|
324
|
+
*
|
|
325
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md
|
|
326
|
+
*/
|
|
327
|
+
"react/jsx-no-script-url": "warn",
|
|
328
|
+
/*
|
|
329
|
+
* Prevent usage of unsafe target='_blank'
|
|
330
|
+
*
|
|
331
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
|
|
332
|
+
*/
|
|
333
|
+
"react/jsx-no-target-blank": "warn",
|
|
334
|
+
/*
|
|
335
|
+
* Disallow undeclared variables in JSX
|
|
336
|
+
*
|
|
337
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
|
|
338
|
+
*/
|
|
339
|
+
"react/jsx-no-undef": "warn",
|
|
340
|
+
/*
|
|
341
|
+
* Disallow unnescessary fragments (fixable)
|
|
342
|
+
*
|
|
343
|
+
* We don't use null in our codebase, but we need to return an empty value
|
|
344
|
+
* in some react components, so the idea of useless fragments doesn't fit
|
|
345
|
+
* how we do things.
|
|
346
|
+
*
|
|
347
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
|
|
348
|
+
*/
|
|
349
|
+
"react/jsx-no-useless-fragment": "off",
|
|
350
|
+
/*
|
|
351
|
+
* Limit to one expression per line in JSX
|
|
352
|
+
*
|
|
353
|
+
* Handled by @stylistic
|
|
354
|
+
*
|
|
355
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
|
|
356
|
+
*/
|
|
357
|
+
"react/jsx-one-expression-per-line": "off",
|
|
358
|
+
/*
|
|
359
|
+
* Enforce PascalCase for user-defined JSX components
|
|
360
|
+
*
|
|
361
|
+
* Handled by @stylistic
|
|
362
|
+
*
|
|
363
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
|
|
364
|
+
*/
|
|
365
|
+
"react/jsx-pascal-case": "off",
|
|
366
|
+
/*
|
|
367
|
+
* Disallow multiple spaces between inline JSX props (fixable)
|
|
368
|
+
*
|
|
369
|
+
* Handled by @stylistic
|
|
370
|
+
*
|
|
371
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md
|
|
372
|
+
*/
|
|
373
|
+
"react/jsx-props-no-multi-spaces": "off",
|
|
374
|
+
/*
|
|
375
|
+
* Disallow JSX prop spreading the same identifier multiple times
|
|
376
|
+
*
|
|
377
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-props-no-spread-multi.md
|
|
378
|
+
*/
|
|
379
|
+
"react/jsx-props-no-spread-multi": "warn",
|
|
380
|
+
/*
|
|
381
|
+
* Disallow JSX props spreading
|
|
382
|
+
*
|
|
383
|
+
* Typescript guards against sending the wrong props through, and the readability
|
|
384
|
+
* issue is overblown since this is only used when you explicitly want to proxy props.
|
|
385
|
+
*
|
|
386
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-props-no-spreading.md
|
|
387
|
+
*/
|
|
388
|
+
"react/jsx-props-no-spreading": "off",
|
|
389
|
+
/*
|
|
390
|
+
* Enforce props alphabetical sorting (fixable)
|
|
391
|
+
*
|
|
392
|
+
* Handled by eslint-plugin-perfectionst
|
|
393
|
+
*
|
|
394
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
|
|
395
|
+
*/
|
|
396
|
+
"react/jsx-sort-props": [
|
|
397
|
+
"off",
|
|
398
|
+
{
|
|
399
|
+
ignoreCase: true,
|
|
400
|
+
},
|
|
401
|
+
],
|
|
402
|
+
/*
|
|
403
|
+
* Validate whitespace in and around the JSX opening and closing brackets (fixable)
|
|
404
|
+
*
|
|
405
|
+
* Handled by @stylistic
|
|
406
|
+
*
|
|
407
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
|
|
408
|
+
*/
|
|
409
|
+
"react/jsx-tag-spacing": "off",
|
|
410
|
+
/*
|
|
411
|
+
* Prevent React to be incorrectly marked as unused
|
|
412
|
+
*
|
|
413
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
|
|
414
|
+
*/
|
|
415
|
+
"react/jsx-uses-react": "warn",
|
|
416
|
+
/*
|
|
417
|
+
* Prevent variables used in JSX to be incorrectly marked as unused
|
|
418
|
+
*
|
|
419
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
|
|
420
|
+
*/
|
|
421
|
+
"react/jsx-uses-vars": "warn",
|
|
422
|
+
/*
|
|
423
|
+
* Prevent missing parentheses around multilines JSX (fixable)
|
|
424
|
+
*
|
|
425
|
+
* Handled by @stylistic
|
|
426
|
+
*
|
|
427
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md
|
|
428
|
+
*/
|
|
429
|
+
"react/jsx-wrap-multilines": "off",
|
|
430
|
+
/*
|
|
431
|
+
* Prevent using this.state inside this.setState
|
|
432
|
+
*
|
|
433
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
|
|
434
|
+
*/
|
|
435
|
+
"react/no-access-state-in-setstate": "warn",
|
|
436
|
+
/*
|
|
437
|
+
* Prevent adjacent inline elements not separated by whitespace
|
|
438
|
+
*
|
|
439
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md
|
|
440
|
+
*/
|
|
441
|
+
"react/no-adjacent-inline-elements": "warn",
|
|
442
|
+
/*
|
|
443
|
+
* Prevent using Array index in key props
|
|
444
|
+
*
|
|
445
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
|
|
446
|
+
*/
|
|
447
|
+
"react/no-array-index-key": "warn",
|
|
448
|
+
/*
|
|
449
|
+
* Lifecycle methods should be methods on the prototype, not class fields
|
|
450
|
+
*
|
|
451
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-arrow-function-lifecycle.md
|
|
452
|
+
*/
|
|
453
|
+
"react/no-arrow-function-lifecycle": "warn",
|
|
454
|
+
/*
|
|
455
|
+
* Prevent passing children as props
|
|
456
|
+
*
|
|
457
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md
|
|
458
|
+
*/
|
|
459
|
+
"react/no-children-prop": "warn",
|
|
460
|
+
/*
|
|
461
|
+
* Prevent usage of dangerous JSX properties
|
|
462
|
+
*
|
|
463
|
+
* Off for now because the name of the attribute communicates the danger by itself, this seems
|
|
464
|
+
*
|
|
465
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md
|
|
466
|
+
*/
|
|
467
|
+
"react/no-danger": "off",
|
|
468
|
+
/*
|
|
469
|
+
* Prevent problem with children and props.dangerouslySetInnerHTML
|
|
470
|
+
*
|
|
471
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md
|
|
472
|
+
*/
|
|
473
|
+
"react/no-danger-with-children": "warn",
|
|
474
|
+
/*
|
|
475
|
+
* Prevent usage of deprecated methods, including component lifecyle methods
|
|
476
|
+
*
|
|
477
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md
|
|
478
|
+
*/
|
|
479
|
+
"react/no-deprecated": "warn",
|
|
480
|
+
/*
|
|
481
|
+
* Prevent usage of setState in componentDidMount
|
|
482
|
+
*
|
|
483
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
|
|
484
|
+
*/
|
|
485
|
+
"react/no-did-mount-set-state": "warn",
|
|
486
|
+
/*
|
|
487
|
+
* Prevent usage of setState in componentDidUpdate
|
|
488
|
+
*
|
|
489
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md
|
|
490
|
+
*/
|
|
491
|
+
"react/no-did-update-set-state": "warn",
|
|
492
|
+
/*
|
|
493
|
+
* Prevent direct mutation of this.state
|
|
494
|
+
*
|
|
495
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md
|
|
496
|
+
*/
|
|
497
|
+
"react/no-direct-mutation-state": "warn",
|
|
498
|
+
/*
|
|
499
|
+
* Prevent usage of findDOMNode
|
|
500
|
+
*
|
|
501
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md
|
|
502
|
+
*/
|
|
503
|
+
"react/no-find-dom-node": "warn",
|
|
504
|
+
/*
|
|
505
|
+
* Prevent usage of invalid attributes
|
|
506
|
+
*
|
|
507
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-invalid-html-attribute.md
|
|
508
|
+
*/
|
|
509
|
+
"react/no-invalid-html-attribute": "warn",
|
|
510
|
+
/*
|
|
511
|
+
* Prevent usage of isMounted
|
|
512
|
+
*
|
|
513
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md
|
|
514
|
+
*/
|
|
515
|
+
"react/no-is-mounted": "warn",
|
|
516
|
+
/*
|
|
517
|
+
* Prevent multiple component definition per file
|
|
518
|
+
*
|
|
519
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
|
|
520
|
+
*/
|
|
521
|
+
"react/no-multi-comp": "warn",
|
|
522
|
+
/*
|
|
523
|
+
* Enforce that namespaces are not used in React elements
|
|
524
|
+
*
|
|
525
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-namespace.md
|
|
526
|
+
*/
|
|
527
|
+
"react/no-namespace": "warn",
|
|
528
|
+
/*
|
|
529
|
+
* Warns if in a functional component, an object type value (such as
|
|
530
|
+
* array/object literal/function/etc) is used as default prop, to prevent
|
|
531
|
+
* potential unnecessary rerenders, and performance regressions.
|
|
532
|
+
*
|
|
533
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-object-type-as-default-prop.md
|
|
534
|
+
*/
|
|
535
|
+
"react/no-object-type-as-default-prop": "off",
|
|
536
|
+
/*
|
|
537
|
+
* Prevent usage of shouldComponentUpdate when extending React.PureComponent
|
|
538
|
+
*
|
|
539
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-redundant-should-component-update.md
|
|
540
|
+
*/
|
|
541
|
+
"react/no-redundant-should-component-update": "warn",
|
|
542
|
+
/*
|
|
543
|
+
* Prevent usage of the return value of React.render
|
|
544
|
+
*
|
|
545
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
|
|
546
|
+
*/
|
|
547
|
+
"react/no-render-return-value": "warn",
|
|
548
|
+
/*
|
|
549
|
+
* Prevent usage of setState
|
|
550
|
+
*
|
|
551
|
+
* We use local component state
|
|
552
|
+
*
|
|
553
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md
|
|
554
|
+
*/
|
|
555
|
+
"react/no-set-state": "off",
|
|
556
|
+
/*
|
|
557
|
+
* Prevent using string references in ref attribute.
|
|
558
|
+
*
|
|
559
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md
|
|
560
|
+
*/
|
|
561
|
+
"react/no-string-refs": "warn",
|
|
562
|
+
/*
|
|
563
|
+
* Prevent using this in stateless functional components
|
|
564
|
+
*
|
|
565
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md
|
|
566
|
+
*/
|
|
567
|
+
"react/no-this-in-sfc": "warn",
|
|
568
|
+
/*
|
|
569
|
+
* Prevent common casing typos
|
|
570
|
+
*
|
|
571
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-typos.md
|
|
572
|
+
*/
|
|
573
|
+
"react/no-typos": "warn",
|
|
574
|
+
/*
|
|
575
|
+
* Prevent invalid characters from appearing in markup
|
|
576
|
+
*
|
|
577
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md
|
|
578
|
+
*/
|
|
579
|
+
"react/no-unescaped-entities": "warn",
|
|
580
|
+
/*
|
|
581
|
+
* Prevent usage of unknown DOM property (fixable)
|
|
582
|
+
*
|
|
583
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
|
|
584
|
+
*/
|
|
585
|
+
"react/no-unknown-property": "warn",
|
|
586
|
+
/*
|
|
587
|
+
* Prevent usage of unsafe lifecycle methods
|
|
588
|
+
*
|
|
589
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unsafe.md
|
|
590
|
+
*/
|
|
591
|
+
"react/no-unsafe": "warn",
|
|
592
|
+
/*
|
|
593
|
+
* Prevent creating unstable components inside components
|
|
594
|
+
*
|
|
595
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
|
|
596
|
+
*/
|
|
597
|
+
"react/no-unstable-nested-components": "warn",
|
|
598
|
+
/*
|
|
599
|
+
* Prevent declaring unused methods of component class
|
|
600
|
+
*
|
|
601
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-class-component-methods.md
|
|
602
|
+
*/
|
|
603
|
+
"react/no-unused-class-component-methods": "warn",
|
|
604
|
+
/*
|
|
605
|
+
* Prevent definitions of unused prop types
|
|
606
|
+
*
|
|
607
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md
|
|
608
|
+
*/
|
|
609
|
+
"react/no-unused-prop-types": "warn",
|
|
610
|
+
/*
|
|
611
|
+
* Prevent definitions of unused state properties
|
|
612
|
+
*
|
|
613
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-state.md
|
|
614
|
+
*/
|
|
615
|
+
"react/no-unused-state": "warn",
|
|
616
|
+
/*
|
|
617
|
+
* Prevent usage of setState in componentWillUpdate
|
|
618
|
+
*
|
|
619
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md
|
|
620
|
+
*/
|
|
621
|
+
"react/no-will-update-set-state": "warn",
|
|
622
|
+
/*
|
|
623
|
+
* Enforce ES5 or ES6 class for React Components
|
|
624
|
+
*
|
|
625
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md
|
|
626
|
+
*/
|
|
627
|
+
"react/prefer-es6-class": "warn",
|
|
628
|
+
/*
|
|
629
|
+
* Prefer exact proptype definitions
|
|
630
|
+
*
|
|
631
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-exact-props.md
|
|
632
|
+
*/
|
|
633
|
+
"react/prefer-exact-props": "warn",
|
|
634
|
+
/*
|
|
635
|
+
* Enforce that props are read-only
|
|
636
|
+
*
|
|
637
|
+
* Off for now because this only works in Flow
|
|
638
|
+
*
|
|
639
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/prefer-read-only-props.md
|
|
640
|
+
*/
|
|
641
|
+
"react/prefer-read-only-props": "off",
|
|
642
|
+
/*
|
|
643
|
+
* Enforce stateless React Components to be written as a pure function
|
|
644
|
+
*
|
|
645
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
|
|
646
|
+
*/
|
|
647
|
+
"react/prefer-stateless-function": [
|
|
648
|
+
"warn",
|
|
649
|
+
{
|
|
650
|
+
ignorePureComponents: true,
|
|
651
|
+
},
|
|
652
|
+
],
|
|
653
|
+
/*
|
|
654
|
+
* Prevent missing props validation in a React component definition
|
|
655
|
+
*
|
|
656
|
+
* We don't do prop validation since we're using typescript
|
|
657
|
+
*
|
|
658
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
|
|
659
|
+
*/
|
|
660
|
+
"react/prop-types": "off",
|
|
661
|
+
/*
|
|
662
|
+
* Prevent missing React when using JSX
|
|
663
|
+
*
|
|
664
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
|
|
665
|
+
*/
|
|
666
|
+
"react/react-in-jsx-scope": "off",
|
|
667
|
+
/*
|
|
668
|
+
* Enforce a defaultProps definition for every prop that is not a required prop
|
|
669
|
+
*
|
|
670
|
+
* Not something that's necessary to enforce since we're using typescript
|
|
671
|
+
*
|
|
672
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md
|
|
673
|
+
*/
|
|
674
|
+
"react/require-default-props": "off",
|
|
675
|
+
/*
|
|
676
|
+
* Enforce React components to have a shouldComponentUpdate method
|
|
677
|
+
*
|
|
678
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-optimization.md
|
|
679
|
+
*/
|
|
680
|
+
"react/require-optimization": "warn",
|
|
681
|
+
/*
|
|
682
|
+
* Enforce ES5 or ES6 class for returning value in render function
|
|
683
|
+
*
|
|
684
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md
|
|
685
|
+
*/
|
|
686
|
+
"react/require-render-return": "warn",
|
|
687
|
+
/*
|
|
688
|
+
* Prevent extra closing tags for components without children (fixable)
|
|
689
|
+
*
|
|
690
|
+
* Handled by @stylistic
|
|
691
|
+
*
|
|
692
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
|
|
693
|
+
*/
|
|
694
|
+
"react/self-closing-comp": "off",
|
|
695
|
+
/*
|
|
696
|
+
* Enforce component methods order (fixable)
|
|
697
|
+
*
|
|
698
|
+
* Off for now because it conflicts with @typescript-eslint/member-ordering
|
|
699
|
+
*
|
|
700
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
|
|
701
|
+
*/
|
|
702
|
+
"react/sort-comp": "off",
|
|
703
|
+
/*
|
|
704
|
+
* Enforce defaultProps declarations alphabetical sorting
|
|
705
|
+
*
|
|
706
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-default-props.md
|
|
707
|
+
*/
|
|
708
|
+
"react/sort-default-props": "off",
|
|
709
|
+
/*
|
|
710
|
+
* Enforce propTypes declarations alphabetical sorting
|
|
711
|
+
*
|
|
712
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md
|
|
713
|
+
*/
|
|
714
|
+
"react/sort-prop-types": "warn",
|
|
715
|
+
/*
|
|
716
|
+
* This rule will enforce the state initialization style to be either in a constructor or with a class property.
|
|
717
|
+
*
|
|
718
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md
|
|
719
|
+
*/
|
|
720
|
+
"react/state-in-constructor": "warn",
|
|
721
|
+
/*
|
|
722
|
+
* Enforces where React component static properties should be positioned.
|
|
723
|
+
*
|
|
724
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md
|
|
725
|
+
*/
|
|
726
|
+
"react/static-property-placement": "warn",
|
|
727
|
+
/*
|
|
728
|
+
* Enforce style prop value being an object
|
|
729
|
+
*
|
|
730
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
|
|
731
|
+
*/
|
|
732
|
+
"react/style-prop-object": "warn",
|
|
733
|
+
/*
|
|
734
|
+
* Prevent void DOM elements (e.g. <img />, <br />) from receiving children
|
|
735
|
+
*
|
|
736
|
+
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
|
|
737
|
+
*/
|
|
738
|
+
"react/void-dom-elements-no-children": "warn",
|
|
739
|
+
},
|
|
740
|
+
};
|