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