@w5s/eslint-config 3.7.3 → 3.10.0
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 +1193 -196
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -15
- package/dist/index.js.map +1 -1
- package/package.json +12 -16
- package/src/config/react.ts +43 -0
- package/src/config.ts +1 -0
- package/src/defineConfig.ts +19 -1
- package/src/typegen/e18e.d.ts +8 -0
- package/src/typegen/react.d.ts +768 -0
- package/src/typegen/unicorn.d.ts +423 -172
- package/src/typegen/yml.d.ts +10 -0
|
@@ -0,0 +1,768 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
import type { Linter } from 'eslint'
|
|
4
|
+
|
|
5
|
+
declare module 'eslint' {
|
|
6
|
+
namespace Linter {
|
|
7
|
+
interface RulesRecord extends RuleOptions {}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RuleOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Disallows DOM elements from using 'dangerouslySetInnerHTML'.
|
|
14
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
15
|
+
*/
|
|
16
|
+
'react/dom-no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>
|
|
17
|
+
/**
|
|
18
|
+
* Disallows DOM elements from using 'dangerouslySetInnerHTML' and 'children' at the same time.
|
|
19
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
20
|
+
*/
|
|
21
|
+
'react/dom-no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>
|
|
22
|
+
/**
|
|
23
|
+
* Disallows 'findDOMNode'.
|
|
24
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
25
|
+
*/
|
|
26
|
+
'react/dom-no-find-dom-node'?: Linter.RuleEntry<[]>
|
|
27
|
+
/**
|
|
28
|
+
* Disallows 'flushSync'.
|
|
29
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-flush-sync
|
|
30
|
+
*/
|
|
31
|
+
'react/dom-no-flush-sync'?: Linter.RuleEntry<[]>
|
|
32
|
+
/**
|
|
33
|
+
* Replaces usage of 'ReactDOM.hydrate()' with 'hydrateRoot()'.
|
|
34
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-hydrate
|
|
35
|
+
*/
|
|
36
|
+
'react/dom-no-hydrate'?: Linter.RuleEntry<[]>
|
|
37
|
+
/**
|
|
38
|
+
* Enforces an explicit 'type' attribute for 'button' elements.
|
|
39
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
40
|
+
*/
|
|
41
|
+
'react/dom-no-missing-button-type'?: Linter.RuleEntry<[]>
|
|
42
|
+
/**
|
|
43
|
+
* Enforces an explicit 'sandbox' attribute for 'iframe' elements.
|
|
44
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
45
|
+
*/
|
|
46
|
+
'react/dom-no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>
|
|
47
|
+
/**
|
|
48
|
+
* Replaces usage of 'ReactDOM.render()' with 'createRoot(node).render()'.
|
|
49
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-render
|
|
50
|
+
*/
|
|
51
|
+
'react/dom-no-render'?: Linter.RuleEntry<[]>
|
|
52
|
+
/**
|
|
53
|
+
* Disallows the return value of 'ReactDOM.render'.
|
|
54
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-render-return-value
|
|
55
|
+
*/
|
|
56
|
+
'react/dom-no-render-return-value'?: Linter.RuleEntry<[]>
|
|
57
|
+
/**
|
|
58
|
+
* Disallows 'javascript:' URLs as attribute values.
|
|
59
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
60
|
+
*/
|
|
61
|
+
'react/dom-no-script-url'?: Linter.RuleEntry<[]>
|
|
62
|
+
/**
|
|
63
|
+
* Disallows the use of string style prop in JSX. Use an object instead.
|
|
64
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
65
|
+
*/
|
|
66
|
+
'react/dom-no-string-style-prop'?: Linter.RuleEntry<[]>
|
|
67
|
+
/**
|
|
68
|
+
* Disallows unknown 'DOM' properties.
|
|
69
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
70
|
+
*/
|
|
71
|
+
'react/dom-no-unknown-property'?: Linter.RuleEntry<ReactDomNoUnknownProperty>
|
|
72
|
+
/**
|
|
73
|
+
* Enforces that the 'sandbox' attribute for 'iframe' elements is not set to unsafe combinations.
|
|
74
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
|
|
75
|
+
*/
|
|
76
|
+
'react/dom-no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>
|
|
77
|
+
/**
|
|
78
|
+
* Disallows 'target="_blank"' without 'rel="noreferrer noopener"'.
|
|
79
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
80
|
+
*/
|
|
81
|
+
'react/dom-no-unsafe-target-blank'?: Linter.RuleEntry<[]>
|
|
82
|
+
/**
|
|
83
|
+
* Replaces usage of 'useFormState' with 'useActionState'.
|
|
84
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-use-form-state
|
|
85
|
+
*/
|
|
86
|
+
'react/dom-no-use-form-state'?: Linter.RuleEntry<[]>
|
|
87
|
+
/**
|
|
88
|
+
* Disallows 'children' in void DOM elements.
|
|
89
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
90
|
+
*/
|
|
91
|
+
'react/dom-no-void-elements-with-children'?: Linter.RuleEntry<[]>
|
|
92
|
+
/**
|
|
93
|
+
* Validates usage of Error Boundaries instead of try/catch for errors in child components.
|
|
94
|
+
* @see https://eslint-react.xyz/docs/rules/error-boundaries
|
|
95
|
+
*/
|
|
96
|
+
'react/error-boundaries'?: Linter.RuleEntry<[]>
|
|
97
|
+
/**
|
|
98
|
+
* Verifies the list of dependencies for Hooks like 'useEffect' and similar.
|
|
99
|
+
* @see https://github.com/facebook/react/issues/14920
|
|
100
|
+
*/
|
|
101
|
+
'react/exhaustive-deps'?: Linter.RuleEntry<ReactExhaustiveDeps>
|
|
102
|
+
/**
|
|
103
|
+
* Validates against assignment/mutation of globals during render, part of ensuring that side effects must run outside of render.
|
|
104
|
+
* @see https://eslint-react.xyz/docs/rules/globals
|
|
105
|
+
*/
|
|
106
|
+
'react/globals'?: Linter.RuleEntry<[]>
|
|
107
|
+
/**
|
|
108
|
+
* Validates against mutating props, state, and other values that are immutable.
|
|
109
|
+
* @see https://eslint-react.xyz/docs/rules/immutability
|
|
110
|
+
*/
|
|
111
|
+
'react/immutability'?: Linter.RuleEntry<[]>
|
|
112
|
+
/**
|
|
113
|
+
* Disallows passing 'children' as a prop.
|
|
114
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-children-prop
|
|
115
|
+
*/
|
|
116
|
+
'react/jsx-no-children-prop'?: Linter.RuleEntry<[]>
|
|
117
|
+
/**
|
|
118
|
+
* Disallows passing 'children' as a prop when children are also passed as nested content.
|
|
119
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-children-prop-with-children
|
|
120
|
+
*/
|
|
121
|
+
'react/jsx-no-children-prop-with-children'?: Linter.RuleEntry<[]>
|
|
122
|
+
/**
|
|
123
|
+
* Prevents comment strings from being accidentally inserted into a JSX element's text nodes.
|
|
124
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
|
|
125
|
+
*/
|
|
126
|
+
'react/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>
|
|
127
|
+
/**
|
|
128
|
+
* Prevent patterns that cause deoptimization when using the automatic JSX runtime.
|
|
129
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-key-after-spread
|
|
130
|
+
*/
|
|
131
|
+
'react/jsx-no-key-after-spread'?: Linter.RuleEntry<[]>
|
|
132
|
+
/**
|
|
133
|
+
* Catches `$` before `{expr}` in JSX — typically from template literal `${expr}` being copy-pasted into JSX without removing the `$`. The `$` "leaks" into the rendered output.
|
|
134
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-leaked-dollar
|
|
135
|
+
*/
|
|
136
|
+
'react/jsx-no-leaked-dollar'?: Linter.RuleEntry<[]>
|
|
137
|
+
/**
|
|
138
|
+
* Catches `;` at the start of JSX text nodes — typically from accidentally placing a statement-ending `;` inside JSX. The `;` "leaks" into the rendered output.
|
|
139
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-leaked-semicolon
|
|
140
|
+
*/
|
|
141
|
+
'react/jsx-no-leaked-semicolon'?: Linter.RuleEntry<[]>
|
|
142
|
+
/**
|
|
143
|
+
* Disallow JSX namespace syntax, as React does not support them.
|
|
144
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-namespace
|
|
145
|
+
*/
|
|
146
|
+
'react/jsx-no-namespace'?: Linter.RuleEntry<[]>
|
|
147
|
+
/**
|
|
148
|
+
* Disallows useless fragment elements.
|
|
149
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-useless-fragment
|
|
150
|
+
*/
|
|
151
|
+
'react/jsx-no-useless-fragment'?: Linter.RuleEntry<ReactJsxNoUselessFragment>
|
|
152
|
+
/**
|
|
153
|
+
* Enforces identifier names assigned from `createContext` calls to be a valid component name with the suffix `Context`.
|
|
154
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
|
|
155
|
+
*/
|
|
156
|
+
'react/naming-convention-context-name'?: Linter.RuleEntry<[]>
|
|
157
|
+
/**
|
|
158
|
+
* Enforces identifier names assigned from 'useId' calls to be either 'id' or end with 'Id'.
|
|
159
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-id-name
|
|
160
|
+
*/
|
|
161
|
+
'react/naming-convention-id-name'?: Linter.RuleEntry<[]>
|
|
162
|
+
/**
|
|
163
|
+
* Enforces identifier names assigned from 'useRef' calls to be either 'ref' or end with 'Ref'.
|
|
164
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-ref-name
|
|
165
|
+
*/
|
|
166
|
+
'react/naming-convention-ref-name'?: Linter.RuleEntry<[]>
|
|
167
|
+
/**
|
|
168
|
+
* Disallows accessing 'this.state' inside 'setState' calls.
|
|
169
|
+
* @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
|
|
170
|
+
*/
|
|
171
|
+
'react/no-access-state-in-setstate'?: Linter.RuleEntry<[]>
|
|
172
|
+
/**
|
|
173
|
+
* Disallows using an item's index in the array as its key.
|
|
174
|
+
* @see https://eslint-react.xyz/docs/rules/no-array-index-key
|
|
175
|
+
*/
|
|
176
|
+
'react/no-array-index-key'?: Linter.RuleEntry<[]>
|
|
177
|
+
/**
|
|
178
|
+
* Disallows the use of 'Children.count' from the 'react' package.
|
|
179
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-count
|
|
180
|
+
*/
|
|
181
|
+
'react/no-children-count'?: Linter.RuleEntry<[]>
|
|
182
|
+
/**
|
|
183
|
+
* Disallows the use of 'Children.forEach' from the 'react' package.
|
|
184
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-for-each
|
|
185
|
+
*/
|
|
186
|
+
'react/no-children-for-each'?: Linter.RuleEntry<[]>
|
|
187
|
+
/**
|
|
188
|
+
* Disallows the use of 'Children.map' from the 'react' package.
|
|
189
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-map
|
|
190
|
+
*/
|
|
191
|
+
'react/no-children-map'?: Linter.RuleEntry<[]>
|
|
192
|
+
/**
|
|
193
|
+
* Disallows the use of 'Children.only' from the 'react' package.
|
|
194
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-only
|
|
195
|
+
*/
|
|
196
|
+
'react/no-children-only'?: Linter.RuleEntry<[]>
|
|
197
|
+
/**
|
|
198
|
+
* Disallows the use of 'Children.toArray' from the 'react' package.
|
|
199
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-to-array
|
|
200
|
+
*/
|
|
201
|
+
'react/no-children-to-array'?: Linter.RuleEntry<[]>
|
|
202
|
+
/**
|
|
203
|
+
* Disallows class components except for error boundaries.
|
|
204
|
+
* @see https://eslint-react.xyz/docs/rules/no-class-component
|
|
205
|
+
*/
|
|
206
|
+
'react/no-class-component'?: Linter.RuleEntry<[]>
|
|
207
|
+
/**
|
|
208
|
+
* Disallows 'cloneElement'.
|
|
209
|
+
* @see https://eslint-react.xyz/docs/rules/no-clone-element
|
|
210
|
+
*/
|
|
211
|
+
'react/no-clone-element'?: Linter.RuleEntry<[]>
|
|
212
|
+
/**
|
|
213
|
+
* Replaces usage of 'componentWillMount' with 'UNSAFE_componentWillMount'.
|
|
214
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-mount
|
|
215
|
+
*/
|
|
216
|
+
'react/no-component-will-mount'?: Linter.RuleEntry<[]>
|
|
217
|
+
/**
|
|
218
|
+
* Replaces usage of 'componentWillReceiveProps' with 'UNSAFE_componentWillReceiveProps'.
|
|
219
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-receive-props
|
|
220
|
+
*/
|
|
221
|
+
'react/no-component-will-receive-props'?: Linter.RuleEntry<[]>
|
|
222
|
+
/**
|
|
223
|
+
* Replaces usage of 'componentWillUpdate' with 'UNSAFE_componentWillUpdate'.
|
|
224
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-update
|
|
225
|
+
*/
|
|
226
|
+
'react/no-component-will-update'?: Linter.RuleEntry<[]>
|
|
227
|
+
/**
|
|
228
|
+
* Replaces usage of '<Context.Provider>' with '<Context>'.
|
|
229
|
+
* @see https://eslint-react.xyz/docs/rules/no-context-provider
|
|
230
|
+
*/
|
|
231
|
+
'react/no-context-provider'?: Linter.RuleEntry<[]>
|
|
232
|
+
/**
|
|
233
|
+
* Disallows 'createRef' in function components and Hooks.
|
|
234
|
+
* @see https://eslint-react.xyz/docs/rules/no-create-ref
|
|
235
|
+
*/
|
|
236
|
+
'react/no-create-ref'?: Linter.RuleEntry<[]>
|
|
237
|
+
/**
|
|
238
|
+
* Disallows direct mutation of 'this.state'.
|
|
239
|
+
* @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
240
|
+
*/
|
|
241
|
+
'react/no-direct-mutation-state'?: Linter.RuleEntry<[]>
|
|
242
|
+
/**
|
|
243
|
+
* Prevents duplicate 'key' props on sibling elements when rendering lists.
|
|
244
|
+
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
245
|
+
*/
|
|
246
|
+
'react/no-duplicate-key'?: Linter.RuleEntry<[]>
|
|
247
|
+
/**
|
|
248
|
+
* Replaces usage of 'forwardRef' with passing 'ref' as a prop.
|
|
249
|
+
* @see https://eslint-react.xyz/docs/rules/no-forward-ref
|
|
250
|
+
*/
|
|
251
|
+
'react/no-forward-ref'?: Linter.RuleEntry<[]>
|
|
252
|
+
/**
|
|
253
|
+
* Prevents implicitly passing the 'children' prop to components.
|
|
254
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-children
|
|
255
|
+
*/
|
|
256
|
+
'react/no-implicit-children'?: Linter.RuleEntry<[]>
|
|
257
|
+
/**
|
|
258
|
+
* Prevents implicitly passing the 'key' prop to components.
|
|
259
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
260
|
+
*/
|
|
261
|
+
'react/no-implicit-key'?: Linter.RuleEntry<[]>
|
|
262
|
+
/**
|
|
263
|
+
* Prevents implicitly passing the 'ref' prop to components.
|
|
264
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-ref
|
|
265
|
+
*/
|
|
266
|
+
'react/no-implicit-ref'?: Linter.RuleEntry<[]>
|
|
267
|
+
/**
|
|
268
|
+
* Prevents problematic leaked values from being rendered.
|
|
269
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
270
|
+
*/
|
|
271
|
+
'react/no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>
|
|
272
|
+
/**
|
|
273
|
+
* Enforces that all components have a 'displayName' that can be used in DevTools.
|
|
274
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
275
|
+
*/
|
|
276
|
+
'react/no-missing-component-display-name'?: Linter.RuleEntry<[]>
|
|
277
|
+
/**
|
|
278
|
+
* Enforces that all contexts have a 'displayName' that can be used in DevTools.
|
|
279
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-context-display-name
|
|
280
|
+
*/
|
|
281
|
+
'react/no-missing-context-display-name'?: Linter.RuleEntry<[]>
|
|
282
|
+
/**
|
|
283
|
+
* Disallows missing 'key' on items in list rendering.
|
|
284
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-key
|
|
285
|
+
*/
|
|
286
|
+
'react/no-missing-key'?: Linter.RuleEntry<[]>
|
|
287
|
+
/**
|
|
288
|
+
* Prevents incorrect usage of 'captureOwnerStack'.
|
|
289
|
+
* @see https://eslint-react.xyz/docs/rules/no-misused-capture-owner-stack
|
|
290
|
+
*/
|
|
291
|
+
'react/no-misused-capture-owner-stack'?: Linter.RuleEntry<[]>
|
|
292
|
+
/**
|
|
293
|
+
* Disallows nesting component definitions inside other components.
|
|
294
|
+
* @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
295
|
+
*/
|
|
296
|
+
'react/no-nested-component-definitions'?: Linter.RuleEntry<[]>
|
|
297
|
+
/**
|
|
298
|
+
* Disallows nesting lazy component declarations inside other components or hooks.
|
|
299
|
+
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
300
|
+
*/
|
|
301
|
+
'react/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>
|
|
302
|
+
/**
|
|
303
|
+
* Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
|
|
304
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
305
|
+
*/
|
|
306
|
+
'react/no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]>
|
|
307
|
+
/**
|
|
308
|
+
* Disallows calling 'this.setState' in 'componentDidUpdate' outside functions such as callbacks.
|
|
309
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update
|
|
310
|
+
*/
|
|
311
|
+
'react/no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>
|
|
312
|
+
/**
|
|
313
|
+
* Disallows calling 'this.setState' in 'componentWillUpdate' outside functions such as callbacks.
|
|
314
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
315
|
+
*/
|
|
316
|
+
'react/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>
|
|
317
|
+
/**
|
|
318
|
+
* Enforces that a function with the 'use' prefix uses at least one Hook inside it.
|
|
319
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
320
|
+
*/
|
|
321
|
+
'react/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>
|
|
322
|
+
/**
|
|
323
|
+
* Warns about the use of 'UNSAFE_componentWillMount' in class components.
|
|
324
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
325
|
+
*/
|
|
326
|
+
'react/no-unsafe-component-will-mount'?: Linter.RuleEntry<[]>
|
|
327
|
+
/**
|
|
328
|
+
* Warns about the use of 'UNSAFE_componentWillReceiveProps' in class components.
|
|
329
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props
|
|
330
|
+
*/
|
|
331
|
+
'react/no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]>
|
|
332
|
+
/**
|
|
333
|
+
* Warns about the use of 'UNSAFE_componentWillUpdate' in class components.
|
|
334
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update
|
|
335
|
+
*/
|
|
336
|
+
'react/no-unsafe-component-will-update'?: Linter.RuleEntry<[]>
|
|
337
|
+
/**
|
|
338
|
+
* Prevents non-stable values (i.e., object literals) from being used as a value for 'Context.Provider'.
|
|
339
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
|
|
340
|
+
*/
|
|
341
|
+
'react/no-unstable-context-value'?: Linter.RuleEntry<[]>
|
|
342
|
+
/**
|
|
343
|
+
* Prevents using referential-type values as default props in object destructuring.
|
|
344
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
345
|
+
*/
|
|
346
|
+
'react/no-unstable-default-props'?: Linter.RuleEntry<ReactNoUnstableDefaultProps>
|
|
347
|
+
/**
|
|
348
|
+
* Warns about unused class component methods and properties.
|
|
349
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
350
|
+
*/
|
|
351
|
+
'react/no-unused-class-component-members'?: Linter.RuleEntry<[]>
|
|
352
|
+
/**
|
|
353
|
+
* Warns about component props that are defined but never used.
|
|
354
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-props
|
|
355
|
+
*/
|
|
356
|
+
'react/no-unused-props'?: Linter.RuleEntry<[]>
|
|
357
|
+
/**
|
|
358
|
+
* Warns about state variables that are defined but never used.
|
|
359
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-state
|
|
360
|
+
*/
|
|
361
|
+
'react/no-unused-state'?: Linter.RuleEntry<[]>
|
|
362
|
+
/**
|
|
363
|
+
* Replaces usage of 'useContext' with 'use'.
|
|
364
|
+
* @see https://eslint-react.xyz/docs/rules/no-use-context
|
|
365
|
+
*/
|
|
366
|
+
'react/no-use-context'?: Linter.RuleEntry<[]>
|
|
367
|
+
/**
|
|
368
|
+
* Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
|
|
369
|
+
* @see https://eslint-react.xyz/docs/rules/purity
|
|
370
|
+
*/
|
|
371
|
+
'react/purity'?: Linter.RuleEntry<[]>
|
|
372
|
+
/**
|
|
373
|
+
* Validates correct usage of refs by checking that 'ref.current' is not read or written during render.
|
|
374
|
+
* @see https://eslint-react.xyz/docs/rules/refs
|
|
375
|
+
*/
|
|
376
|
+
'react/refs'?: Linter.RuleEntry<[]>
|
|
377
|
+
/**
|
|
378
|
+
* Validates and transforms React Client/Server Function definitions.
|
|
379
|
+
* @see https://eslint-react.xyz/docs/rules/rsc-function-definition
|
|
380
|
+
*/
|
|
381
|
+
'react/rsc-function-definition'?: Linter.RuleEntry<[]>
|
|
382
|
+
/**
|
|
383
|
+
* Enforces the Rules of Hooks.
|
|
384
|
+
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
385
|
+
*/
|
|
386
|
+
'react/rules-of-hooks'?: Linter.RuleEntry<ReactRulesOfHooks>
|
|
387
|
+
/**
|
|
388
|
+
* Validates against setting state synchronously in an effect, which can lead to re-renders that degrade performance.
|
|
389
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-effect
|
|
390
|
+
*/
|
|
391
|
+
'react/set-state-in-effect'?: Linter.RuleEntry<[]>
|
|
392
|
+
/**
|
|
393
|
+
* Validates against unconditionally setting state during render, which can trigger additional renders and potential infinite render loops.
|
|
394
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-render
|
|
395
|
+
*/
|
|
396
|
+
'react/set-state-in-render'?: Linter.RuleEntry<[]>
|
|
397
|
+
/**
|
|
398
|
+
* Validates that components are static, not recreated every render.
|
|
399
|
+
* @see https://eslint-react.xyz/docs/rules/static-components
|
|
400
|
+
*/
|
|
401
|
+
'react/static-components'?: Linter.RuleEntry<[]>
|
|
402
|
+
/**
|
|
403
|
+
* Validates against syntax that React Compiler does not support.
|
|
404
|
+
* @see https://eslint-react.xyz/docs/rules/unsupported-syntax
|
|
405
|
+
*/
|
|
406
|
+
'react/unsupported-syntax'?: Linter.RuleEntry<[]>
|
|
407
|
+
/**
|
|
408
|
+
* Validates that 'useMemo' is called with a callback that returns a value.
|
|
409
|
+
* @see https://eslint-react.xyz/docs/rules/use-memo
|
|
410
|
+
*/
|
|
411
|
+
'react/use-memo'?: Linter.RuleEntry<[]>
|
|
412
|
+
/**
|
|
413
|
+
* Enforces correct usage of 'useState', including destructuring, symmetric naming of the value and setter, and wrapping expensive initializers in a lazy initializer function.
|
|
414
|
+
* @see https://eslint-react.xyz/docs/rules/use-state
|
|
415
|
+
*/
|
|
416
|
+
'react/use-state'?: Linter.RuleEntry<ReactUseState>
|
|
417
|
+
/**
|
|
418
|
+
* Enforces that every 'addEventListener' in a component or custom hook has a corresponding 'removeEventListener'.
|
|
419
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
|
|
420
|
+
*/
|
|
421
|
+
'react/web-api-no-leaked-event-listener'?: Linter.RuleEntry<[]>
|
|
422
|
+
/**
|
|
423
|
+
* Enforces that every 'fetch' in a component or custom hook has a corresponding 'AbortController' abort in the cleanup function.
|
|
424
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-fetch
|
|
425
|
+
*/
|
|
426
|
+
'react/web-api-no-leaked-fetch'?: Linter.RuleEntry<[]>
|
|
427
|
+
/**
|
|
428
|
+
* Enforces that every 'IntersectionObserver' created in a component or custom hook has a corresponding 'IntersectionObserver.disconnect()'.
|
|
429
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-intersection-observer
|
|
430
|
+
*/
|
|
431
|
+
'react/web-api-no-leaked-intersection-observer'?: Linter.RuleEntry<[]>
|
|
432
|
+
/**
|
|
433
|
+
* Enforces that every 'setInterval' in a component or custom hook has a corresponding 'clearInterval'.
|
|
434
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
|
|
435
|
+
*/
|
|
436
|
+
'react/web-api-no-leaked-interval'?: Linter.RuleEntry<[]>
|
|
437
|
+
/**
|
|
438
|
+
* Enforces that every 'ResizeObserver' created in a component or custom hook has a corresponding 'ResizeObserver.disconnect()'.
|
|
439
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
|
|
440
|
+
*/
|
|
441
|
+
'react/web-api-no-leaked-resize-observer'?: Linter.RuleEntry<[]>
|
|
442
|
+
/**
|
|
443
|
+
* Enforces that every 'setTimeout' in a component or custom hook has a corresponding 'clearTimeout'.
|
|
444
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
|
|
445
|
+
*/
|
|
446
|
+
'react/web-api-no-leaked-timeout'?: Linter.RuleEntry<[]>
|
|
447
|
+
/**
|
|
448
|
+
* Validates usage of Error Boundaries instead of try/catch for errors in child components.
|
|
449
|
+
* @see https://eslint-react.xyz/docs/rules/error-boundaries
|
|
450
|
+
*/
|
|
451
|
+
'react/x-error-boundaries'?: Linter.RuleEntry<[]>
|
|
452
|
+
/**
|
|
453
|
+
* Verifies the list of dependencies for Hooks like 'useEffect' and similar.
|
|
454
|
+
* @see https://github.com/facebook/react/issues/14920
|
|
455
|
+
*/
|
|
456
|
+
'react/x-exhaustive-deps'?: Linter.RuleEntry<ReactXExhaustiveDeps>
|
|
457
|
+
/**
|
|
458
|
+
* Validates against assignment/mutation of globals during render, part of ensuring that side effects must run outside of render.
|
|
459
|
+
* @see https://eslint-react.xyz/docs/rules/globals
|
|
460
|
+
*/
|
|
461
|
+
'react/x-globals'?: Linter.RuleEntry<[]>
|
|
462
|
+
/**
|
|
463
|
+
* Validates against mutating props, state, and other values that are immutable.
|
|
464
|
+
* @see https://eslint-react.xyz/docs/rules/immutability
|
|
465
|
+
*/
|
|
466
|
+
'react/x-immutability'?: Linter.RuleEntry<[]>
|
|
467
|
+
/**
|
|
468
|
+
* Disallows accessing 'this.state' inside 'setState' calls.
|
|
469
|
+
* @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
|
|
470
|
+
*/
|
|
471
|
+
'react/x-no-access-state-in-setstate'?: Linter.RuleEntry<[]>
|
|
472
|
+
/**
|
|
473
|
+
* Disallows using an item's index in the array as its key.
|
|
474
|
+
* @see https://eslint-react.xyz/docs/rules/no-array-index-key
|
|
475
|
+
*/
|
|
476
|
+
'react/x-no-array-index-key'?: Linter.RuleEntry<[]>
|
|
477
|
+
/**
|
|
478
|
+
* Disallows the use of 'Children.count' from the 'react' package.
|
|
479
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-count
|
|
480
|
+
*/
|
|
481
|
+
'react/x-no-children-count'?: Linter.RuleEntry<[]>
|
|
482
|
+
/**
|
|
483
|
+
* Disallows the use of 'Children.forEach' from the 'react' package.
|
|
484
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-for-each
|
|
485
|
+
*/
|
|
486
|
+
'react/x-no-children-for-each'?: Linter.RuleEntry<[]>
|
|
487
|
+
/**
|
|
488
|
+
* Disallows the use of 'Children.map' from the 'react' package.
|
|
489
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-map
|
|
490
|
+
*/
|
|
491
|
+
'react/x-no-children-map'?: Linter.RuleEntry<[]>
|
|
492
|
+
/**
|
|
493
|
+
* Disallows the use of 'Children.only' from the 'react' package.
|
|
494
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-only
|
|
495
|
+
*/
|
|
496
|
+
'react/x-no-children-only'?: Linter.RuleEntry<[]>
|
|
497
|
+
/**
|
|
498
|
+
* Disallows the use of 'Children.toArray' from the 'react' package.
|
|
499
|
+
* @see https://eslint-react.xyz/docs/rules/no-children-to-array
|
|
500
|
+
*/
|
|
501
|
+
'react/x-no-children-to-array'?: Linter.RuleEntry<[]>
|
|
502
|
+
/**
|
|
503
|
+
* Disallows class components except for error boundaries.
|
|
504
|
+
* @see https://eslint-react.xyz/docs/rules/no-class-component
|
|
505
|
+
*/
|
|
506
|
+
'react/x-no-class-component'?: Linter.RuleEntry<[]>
|
|
507
|
+
/**
|
|
508
|
+
* Disallows 'cloneElement'.
|
|
509
|
+
* @see https://eslint-react.xyz/docs/rules/no-clone-element
|
|
510
|
+
*/
|
|
511
|
+
'react/x-no-clone-element'?: Linter.RuleEntry<[]>
|
|
512
|
+
/**
|
|
513
|
+
* Replaces usage of 'componentWillMount' with 'UNSAFE_componentWillMount'.
|
|
514
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-mount
|
|
515
|
+
*/
|
|
516
|
+
'react/x-no-component-will-mount'?: Linter.RuleEntry<[]>
|
|
517
|
+
/**
|
|
518
|
+
* Replaces usage of 'componentWillReceiveProps' with 'UNSAFE_componentWillReceiveProps'.
|
|
519
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-receive-props
|
|
520
|
+
*/
|
|
521
|
+
'react/x-no-component-will-receive-props'?: Linter.RuleEntry<[]>
|
|
522
|
+
/**
|
|
523
|
+
* Replaces usage of 'componentWillUpdate' with 'UNSAFE_componentWillUpdate'.
|
|
524
|
+
* @see https://eslint-react.xyz/docs/rules/no-component-will-update
|
|
525
|
+
*/
|
|
526
|
+
'react/x-no-component-will-update'?: Linter.RuleEntry<[]>
|
|
527
|
+
/**
|
|
528
|
+
* Replaces usage of '<Context.Provider>' with '<Context>'.
|
|
529
|
+
* @see https://eslint-react.xyz/docs/rules/no-context-provider
|
|
530
|
+
*/
|
|
531
|
+
'react/x-no-context-provider'?: Linter.RuleEntry<[]>
|
|
532
|
+
/**
|
|
533
|
+
* Disallows 'createRef' in function components and Hooks.
|
|
534
|
+
* @see https://eslint-react.xyz/docs/rules/no-create-ref
|
|
535
|
+
*/
|
|
536
|
+
'react/x-no-create-ref'?: Linter.RuleEntry<[]>
|
|
537
|
+
/**
|
|
538
|
+
* Disallows direct mutation of 'this.state'.
|
|
539
|
+
* @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
540
|
+
*/
|
|
541
|
+
'react/x-no-direct-mutation-state'?: Linter.RuleEntry<[]>
|
|
542
|
+
/**
|
|
543
|
+
* Prevents duplicate 'key' props on sibling elements when rendering lists.
|
|
544
|
+
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
545
|
+
*/
|
|
546
|
+
'react/x-no-duplicate-key'?: Linter.RuleEntry<[]>
|
|
547
|
+
/**
|
|
548
|
+
* Replaces usage of 'forwardRef' with passing 'ref' as a prop.
|
|
549
|
+
* @see https://eslint-react.xyz/docs/rules/no-forward-ref
|
|
550
|
+
*/
|
|
551
|
+
'react/x-no-forward-ref'?: Linter.RuleEntry<[]>
|
|
552
|
+
/**
|
|
553
|
+
* Prevents implicitly passing the 'children' prop to components.
|
|
554
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-children
|
|
555
|
+
*/
|
|
556
|
+
'react/x-no-implicit-children'?: Linter.RuleEntry<[]>
|
|
557
|
+
/**
|
|
558
|
+
* Prevents implicitly passing the 'key' prop to components.
|
|
559
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
560
|
+
*/
|
|
561
|
+
'react/x-no-implicit-key'?: Linter.RuleEntry<[]>
|
|
562
|
+
/**
|
|
563
|
+
* Prevents implicitly passing the 'ref' prop to components.
|
|
564
|
+
* @see https://eslint-react.xyz/docs/rules/no-implicit-ref
|
|
565
|
+
*/
|
|
566
|
+
'react/x-no-implicit-ref'?: Linter.RuleEntry<[]>
|
|
567
|
+
/**
|
|
568
|
+
* Prevents problematic leaked values from being rendered.
|
|
569
|
+
* @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
570
|
+
*/
|
|
571
|
+
'react/x-no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>
|
|
572
|
+
/**
|
|
573
|
+
* Enforces that all components have a 'displayName' that can be used in DevTools.
|
|
574
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
575
|
+
*/
|
|
576
|
+
'react/x-no-missing-component-display-name'?: Linter.RuleEntry<[]>
|
|
577
|
+
/**
|
|
578
|
+
* Enforces that all contexts have a 'displayName' that can be used in DevTools.
|
|
579
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-context-display-name
|
|
580
|
+
*/
|
|
581
|
+
'react/x-no-missing-context-display-name'?: Linter.RuleEntry<[]>
|
|
582
|
+
/**
|
|
583
|
+
* Disallows missing 'key' on items in list rendering.
|
|
584
|
+
* @see https://eslint-react.xyz/docs/rules/no-missing-key
|
|
585
|
+
*/
|
|
586
|
+
'react/x-no-missing-key'?: Linter.RuleEntry<[]>
|
|
587
|
+
/**
|
|
588
|
+
* Prevents incorrect usage of 'captureOwnerStack'.
|
|
589
|
+
* @see https://eslint-react.xyz/docs/rules/no-misused-capture-owner-stack
|
|
590
|
+
*/
|
|
591
|
+
'react/x-no-misused-capture-owner-stack'?: Linter.RuleEntry<[]>
|
|
592
|
+
/**
|
|
593
|
+
* Disallows nesting component definitions inside other components.
|
|
594
|
+
* @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
595
|
+
*/
|
|
596
|
+
'react/x-no-nested-component-definitions'?: Linter.RuleEntry<[]>
|
|
597
|
+
/**
|
|
598
|
+
* Disallows nesting lazy component declarations inside other components or hooks.
|
|
599
|
+
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
600
|
+
*/
|
|
601
|
+
'react/x-no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>
|
|
602
|
+
/**
|
|
603
|
+
* Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
|
|
604
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
605
|
+
*/
|
|
606
|
+
'react/x-no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]>
|
|
607
|
+
/**
|
|
608
|
+
* Disallows calling 'this.setState' in 'componentDidUpdate' outside functions such as callbacks.
|
|
609
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update
|
|
610
|
+
*/
|
|
611
|
+
'react/x-no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>
|
|
612
|
+
/**
|
|
613
|
+
* Disallows calling 'this.setState' in 'componentWillUpdate' outside functions such as callbacks.
|
|
614
|
+
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
615
|
+
*/
|
|
616
|
+
'react/x-no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>
|
|
617
|
+
/**
|
|
618
|
+
* Enforces that a function with the 'use' prefix uses at least one Hook inside it.
|
|
619
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
620
|
+
*/
|
|
621
|
+
'react/x-no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>
|
|
622
|
+
/**
|
|
623
|
+
* Warns about the use of 'UNSAFE_componentWillMount' in class components.
|
|
624
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
625
|
+
*/
|
|
626
|
+
'react/x-no-unsafe-component-will-mount'?: Linter.RuleEntry<[]>
|
|
627
|
+
/**
|
|
628
|
+
* Warns about the use of 'UNSAFE_componentWillReceiveProps' in class components.
|
|
629
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props
|
|
630
|
+
*/
|
|
631
|
+
'react/x-no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]>
|
|
632
|
+
/**
|
|
633
|
+
* Warns about the use of 'UNSAFE_componentWillUpdate' in class components.
|
|
634
|
+
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update
|
|
635
|
+
*/
|
|
636
|
+
'react/x-no-unsafe-component-will-update'?: Linter.RuleEntry<[]>
|
|
637
|
+
/**
|
|
638
|
+
* Prevents non-stable values (i.e., object literals) from being used as a value for 'Context.Provider'.
|
|
639
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
|
|
640
|
+
*/
|
|
641
|
+
'react/x-no-unstable-context-value'?: Linter.RuleEntry<[]>
|
|
642
|
+
/**
|
|
643
|
+
* Prevents using referential-type values as default props in object destructuring.
|
|
644
|
+
* @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
645
|
+
*/
|
|
646
|
+
'react/x-no-unstable-default-props'?: Linter.RuleEntry<ReactXNoUnstableDefaultProps>
|
|
647
|
+
/**
|
|
648
|
+
* Warns about unused class component methods and properties.
|
|
649
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
650
|
+
*/
|
|
651
|
+
'react/x-no-unused-class-component-members'?: Linter.RuleEntry<[]>
|
|
652
|
+
/**
|
|
653
|
+
* Warns about component props that are defined but never used.
|
|
654
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-props
|
|
655
|
+
*/
|
|
656
|
+
'react/x-no-unused-props'?: Linter.RuleEntry<[]>
|
|
657
|
+
/**
|
|
658
|
+
* Warns about state variables that are defined but never used.
|
|
659
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-state
|
|
660
|
+
*/
|
|
661
|
+
'react/x-no-unused-state'?: Linter.RuleEntry<[]>
|
|
662
|
+
/**
|
|
663
|
+
* Replaces usage of 'useContext' with 'use'.
|
|
664
|
+
* @see https://eslint-react.xyz/docs/rules/no-use-context
|
|
665
|
+
*/
|
|
666
|
+
'react/x-no-use-context'?: Linter.RuleEntry<[]>
|
|
667
|
+
/**
|
|
668
|
+
* Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
|
|
669
|
+
* @see https://eslint-react.xyz/docs/rules/purity
|
|
670
|
+
*/
|
|
671
|
+
'react/x-purity'?: Linter.RuleEntry<[]>
|
|
672
|
+
/**
|
|
673
|
+
* Validates correct usage of refs by checking that 'ref.current' is not read or written during render.
|
|
674
|
+
* @see https://eslint-react.xyz/docs/rules/refs
|
|
675
|
+
*/
|
|
676
|
+
'react/x-refs'?: Linter.RuleEntry<[]>
|
|
677
|
+
/**
|
|
678
|
+
* Enforces the Rules of Hooks.
|
|
679
|
+
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
680
|
+
*/
|
|
681
|
+
'react/x-rules-of-hooks'?: Linter.RuleEntry<ReactXRulesOfHooks>
|
|
682
|
+
/**
|
|
683
|
+
* Validates against setting state synchronously in an effect, which can lead to re-renders that degrade performance.
|
|
684
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-effect
|
|
685
|
+
*/
|
|
686
|
+
'react/x-set-state-in-effect'?: Linter.RuleEntry<[]>
|
|
687
|
+
/**
|
|
688
|
+
* Validates against unconditionally setting state during render, which can trigger additional renders and potential infinite render loops.
|
|
689
|
+
* @see https://eslint-react.xyz/docs/rules/set-state-in-render
|
|
690
|
+
*/
|
|
691
|
+
'react/x-set-state-in-render'?: Linter.RuleEntry<[]>
|
|
692
|
+
/**
|
|
693
|
+
* Validates that components are static, not recreated every render.
|
|
694
|
+
* @see https://eslint-react.xyz/docs/rules/static-components
|
|
695
|
+
*/
|
|
696
|
+
'react/x-static-components'?: Linter.RuleEntry<[]>
|
|
697
|
+
/**
|
|
698
|
+
* Validates against syntax that React Compiler does not support.
|
|
699
|
+
* @see https://eslint-react.xyz/docs/rules/unsupported-syntax
|
|
700
|
+
*/
|
|
701
|
+
'react/x-unsupported-syntax'?: Linter.RuleEntry<[]>
|
|
702
|
+
/**
|
|
703
|
+
* Validates that 'useMemo' is called with a callback that returns a value.
|
|
704
|
+
* @see https://eslint-react.xyz/docs/rules/use-memo
|
|
705
|
+
*/
|
|
706
|
+
'react/x-use-memo'?: Linter.RuleEntry<[]>
|
|
707
|
+
/**
|
|
708
|
+
* Enforces correct usage of 'useState', including destructuring, symmetric naming of the value and setter, and wrapping expensive initializers in a lazy initializer function.
|
|
709
|
+
* @see https://eslint-react.xyz/docs/rules/use-state
|
|
710
|
+
*/
|
|
711
|
+
'react/x-use-state'?: Linter.RuleEntry<ReactXUseState>
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/* ======= Declarations ======= */
|
|
715
|
+
// ----- react/dom-no-unknown-property -----
|
|
716
|
+
type ReactDomNoUnknownProperty = []|[{
|
|
717
|
+
ignore?: string[]
|
|
718
|
+
requireDataLowercase?: boolean
|
|
719
|
+
}]
|
|
720
|
+
// ----- react/exhaustive-deps -----
|
|
721
|
+
type ReactExhaustiveDeps = []|[{
|
|
722
|
+
additionalHooks?: string
|
|
723
|
+
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean
|
|
724
|
+
experimental_autoDependenciesHooks?: string[]
|
|
725
|
+
requireExplicitEffectDeps?: boolean
|
|
726
|
+
}]
|
|
727
|
+
// ----- react/jsx-no-useless-fragment -----
|
|
728
|
+
type ReactJsxNoUselessFragment = []|[{
|
|
729
|
+
|
|
730
|
+
allowEmptyFragment?: boolean
|
|
731
|
+
|
|
732
|
+
allowExpressions?: boolean
|
|
733
|
+
}]
|
|
734
|
+
// ----- react/no-unstable-default-props -----
|
|
735
|
+
type ReactNoUnstableDefaultProps = []|[{
|
|
736
|
+
safeDefaultProps?: string[]
|
|
737
|
+
}]
|
|
738
|
+
// ----- react/rules-of-hooks -----
|
|
739
|
+
type ReactRulesOfHooks = []|[{
|
|
740
|
+
additionalHooks?: string
|
|
741
|
+
}]
|
|
742
|
+
// ----- react/use-state -----
|
|
743
|
+
type ReactUseState = []|[{
|
|
744
|
+
enforceAssignment?: boolean
|
|
745
|
+
enforceLazyInitialization?: boolean
|
|
746
|
+
enforceSetterName?: boolean
|
|
747
|
+
}]
|
|
748
|
+
// ----- react/x-exhaustive-deps -----
|
|
749
|
+
type ReactXExhaustiveDeps = []|[{
|
|
750
|
+
additionalHooks?: string
|
|
751
|
+
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean
|
|
752
|
+
experimental_autoDependenciesHooks?: string[]
|
|
753
|
+
requireExplicitEffectDeps?: boolean
|
|
754
|
+
}]
|
|
755
|
+
// ----- react/x-no-unstable-default-props -----
|
|
756
|
+
type ReactXNoUnstableDefaultProps = []|[{
|
|
757
|
+
safeDefaultProps?: string[]
|
|
758
|
+
}]
|
|
759
|
+
// ----- react/x-rules-of-hooks -----
|
|
760
|
+
type ReactXRulesOfHooks = []|[{
|
|
761
|
+
additionalHooks?: string
|
|
762
|
+
}]
|
|
763
|
+
// ----- react/x-use-state -----
|
|
764
|
+
type ReactXUseState = []|[{
|
|
765
|
+
enforceAssignment?: boolean
|
|
766
|
+
enforceLazyInitialization?: boolean
|
|
767
|
+
enforceSetterName?: boolean
|
|
768
|
+
}]
|