@2digits/eslint-config 4.15.2 → 4.15.4
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.mts
CHANGED
|
@@ -48,6 +48,11 @@ interface RuleOptions {
|
|
|
48
48
|
* @see https://github.com/2digits-agency/configs/tree/main/packages/eslint-plugin/src/rules/if-curly.ts
|
|
49
49
|
*/
|
|
50
50
|
'@2digits/if-curly'?: Linter.RuleEntry<[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Disallow the use of `null` except when required by external types
|
|
53
|
+
* @see https://github.com/2digits-agency/configs/tree/main/packages/eslint-plugin/src/rules/no-null.ts
|
|
54
|
+
*/
|
|
55
|
+
'@2digits/no-null'?: Linter.RuleEntry<[]>;
|
|
51
56
|
/**
|
|
52
57
|
* Disallow passing function references to array methods
|
|
53
58
|
* @see https://github.com/2digits-agency/configs/tree/main/packages/eslint-plugin/src/rules/prefer-inline-array-callbacks.ts
|
|
@@ -3146,97 +3151,97 @@ interface RuleOptions {
|
|
|
3146
3151
|
*/
|
|
3147
3152
|
'react-compiler/react-compiler'?: Linter.RuleEntry<ReactCompilerReactCompiler>;
|
|
3148
3153
|
/**
|
|
3149
|
-
*
|
|
3154
|
+
* Disallows 'dangerouslySetInnerHTML'.
|
|
3150
3155
|
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
3151
3156
|
*/
|
|
3152
3157
|
'react-dom/no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]>;
|
|
3153
3158
|
/**
|
|
3154
|
-
*
|
|
3159
|
+
* Disallows 'dangerouslySetInnerHTML' and 'children' at the same time.
|
|
3155
3160
|
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
3156
3161
|
*/
|
|
3157
3162
|
'react-dom/no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]>;
|
|
3158
3163
|
/**
|
|
3159
|
-
*
|
|
3164
|
+
* Disallows 'findDOMNode'.
|
|
3160
3165
|
* @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
3161
3166
|
*/
|
|
3162
3167
|
'react-dom/no-find-dom-node'?: Linter.RuleEntry<[]>;
|
|
3163
3168
|
/**
|
|
3164
|
-
*
|
|
3169
|
+
* Disallows 'flushSync'.
|
|
3165
3170
|
* @see https://eslint-react.xyz/docs/rules/dom-no-flush-sync
|
|
3166
3171
|
*/
|
|
3167
3172
|
'react-dom/no-flush-sync'?: Linter.RuleEntry<[]>;
|
|
3168
3173
|
/**
|
|
3169
|
-
* Replaces
|
|
3174
|
+
* Replaces usage of 'ReactDom.hydrate()' with 'hydrateRoot()'.
|
|
3170
3175
|
* @see https://eslint-react.xyz/docs/rules/dom-no-hydrate
|
|
3171
3176
|
*/
|
|
3172
3177
|
'react-dom/no-hydrate'?: Linter.RuleEntry<[]>;
|
|
3173
3178
|
/**
|
|
3174
|
-
* Enforces explicit
|
|
3179
|
+
* Enforces explicit 'type' attribute for 'button' elements.
|
|
3175
3180
|
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
3176
3181
|
*/
|
|
3177
3182
|
'react-dom/no-missing-button-type'?: Linter.RuleEntry<[]>;
|
|
3178
3183
|
/**
|
|
3179
|
-
* Enforces explicit
|
|
3184
|
+
* Enforces explicit 'sandbox' attribute for 'iframe' elements.
|
|
3180
3185
|
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
3181
3186
|
*/
|
|
3182
3187
|
'react-dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>;
|
|
3183
3188
|
/**
|
|
3184
|
-
* Enforces the absence of a
|
|
3189
|
+
* Enforces the absence of a 'namespace' in React elements.
|
|
3185
3190
|
* @see https://eslint-react.xyz/docs/rules/dom-no-namespace
|
|
3186
3191
|
*/
|
|
3187
3192
|
'react-dom/no-namespace'?: Linter.RuleEntry<[]>;
|
|
3188
3193
|
/**
|
|
3189
|
-
* Replaces
|
|
3194
|
+
* Replaces usage of 'ReactDom.render()' with 'createRoot(node).render()'.
|
|
3190
3195
|
* @see https://eslint-react.xyz/docs/rules/dom-no-render
|
|
3191
3196
|
*/
|
|
3192
3197
|
'react-dom/no-render'?: Linter.RuleEntry<[]>;
|
|
3193
3198
|
/**
|
|
3194
|
-
*
|
|
3199
|
+
* Disallows the return value of 'ReactDOM.render'.
|
|
3195
3200
|
* @see https://eslint-react.xyz/docs/rules/dom-no-render-return-value
|
|
3196
3201
|
*/
|
|
3197
3202
|
'react-dom/no-render-return-value'?: Linter.RuleEntry<[]>;
|
|
3198
3203
|
/**
|
|
3199
|
-
*
|
|
3204
|
+
* Disallows 'javascript:' URLs as attribute values.
|
|
3200
3205
|
* @see https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
3201
3206
|
*/
|
|
3202
3207
|
'react-dom/no-script-url'?: Linter.RuleEntry<[]>;
|
|
3203
3208
|
/**
|
|
3204
|
-
* Disallows the use of string style prop.
|
|
3209
|
+
* Disallows the use of string style prop in JSX. Use an object instead.
|
|
3205
3210
|
* @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
3206
3211
|
*/
|
|
3207
3212
|
'react-dom/no-string-style-prop'?: Linter.RuleEntry<[]>;
|
|
3208
3213
|
/**
|
|
3209
|
-
*
|
|
3214
|
+
* Disallows unknown 'DOM' property.
|
|
3210
3215
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
3211
3216
|
*/
|
|
3212
3217
|
'react-dom/no-unknown-property'?: Linter.RuleEntry<ReactDomNoUnknownProperty>;
|
|
3213
3218
|
/**
|
|
3214
|
-
* Enforces
|
|
3219
|
+
* Enforces 'sandbox' attribute for 'iframe' elements is not set to unsafe combinations.
|
|
3215
3220
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
|
|
3216
3221
|
*/
|
|
3217
3222
|
'react-dom/no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>;
|
|
3218
3223
|
/**
|
|
3219
|
-
*
|
|
3224
|
+
* Disallows 'target="_blank"' without 'rel="noreferrer noopener"'.
|
|
3220
3225
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
3221
3226
|
*/
|
|
3222
3227
|
'react-dom/no-unsafe-target-blank'?: Linter.RuleEntry<[]>;
|
|
3223
3228
|
/**
|
|
3224
|
-
* Replaces
|
|
3229
|
+
* Replaces usage of 'useFormState' with 'useActionState'.
|
|
3225
3230
|
* @see https://eslint-react.xyz/docs/rules/dom-no-use-form-state
|
|
3226
3231
|
*/
|
|
3227
3232
|
'react-dom/no-use-form-state'?: Linter.RuleEntry<[]>;
|
|
3228
3233
|
/**
|
|
3229
|
-
*
|
|
3234
|
+
* Disallows 'children' in void DOM elements.
|
|
3230
3235
|
* @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
3231
3236
|
*/
|
|
3232
3237
|
'react-dom/no-void-elements-with-children'?: Linter.RuleEntry<[]>;
|
|
3233
3238
|
/**
|
|
3234
|
-
* Enforces React
|
|
3239
|
+
* Enforces React DOM is imported via a namespace import.
|
|
3235
3240
|
* @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
|
|
3236
3241
|
*/
|
|
3237
3242
|
'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>;
|
|
3238
3243
|
/**
|
|
3239
|
-
* Prevents dollar signs from being inserted
|
|
3244
|
+
* Prevents unnecessary dollar signs ('$') from being inserted before an expression in JSX.
|
|
3240
3245
|
* @see https://eslint-react.xyz/docs/rules/jsx-dollar
|
|
3241
3246
|
*/
|
|
3242
3247
|
'react-extra/jsx-dollar'?: Linter.RuleEntry<[]>;
|
|
@@ -3246,37 +3251,37 @@ interface RuleOptions {
|
|
|
3246
3251
|
*/
|
|
3247
3252
|
'react-extra/jsx-key-before-spread'?: Linter.RuleEntry<[]>;
|
|
3248
3253
|
/**
|
|
3249
|
-
* Prevents
|
|
3254
|
+
* Prevents comment strings (e.g., beginning with '//' or '/*') from being accidentally inserted into a JSX element's text nodes.
|
|
3250
3255
|
* @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
|
|
3251
3256
|
*/
|
|
3252
3257
|
'react-extra/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
|
|
3253
3258
|
/**
|
|
3254
|
-
*
|
|
3259
|
+
* Disallows duplicate props in JSX elements.
|
|
3255
3260
|
* @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
|
|
3256
3261
|
*/
|
|
3257
3262
|
'react-extra/jsx-no-duplicate-props'?: Linter.RuleEntry<[]>;
|
|
3258
3263
|
/**
|
|
3259
|
-
* Disallows 'IIFE' in JSX
|
|
3264
|
+
* Disallows 'IIFE' in JSX.
|
|
3260
3265
|
* @see https://eslint-react.xyz/docs/rules/jsx-no-iife
|
|
3261
3266
|
*/
|
|
3262
3267
|
'react-extra/jsx-no-iife'?: Linter.RuleEntry<[]>;
|
|
3263
3268
|
/**
|
|
3264
|
-
*
|
|
3269
|
+
* Prevents using variables in JSX that are not defined in the scope.
|
|
3265
3270
|
* @see https://eslint-react.xyz/docs/rules/jsx-no-undef
|
|
3266
3271
|
*/
|
|
3267
3272
|
'react-extra/jsx-no-undef'?: Linter.RuleEntry<[]>;
|
|
3268
3273
|
/**
|
|
3269
|
-
* Enforces shorthand syntax for boolean attributes.
|
|
3274
|
+
* Enforces the use of shorthand syntax for boolean attributes.
|
|
3270
3275
|
* @see https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean
|
|
3271
3276
|
*/
|
|
3272
3277
|
'react-extra/jsx-shorthand-boolean'?: Linter.RuleEntry<ReactExtraJsxShorthandBoolean>;
|
|
3273
3278
|
/**
|
|
3274
|
-
* Enforces shorthand syntax for fragments.
|
|
3279
|
+
* Enforces the use of shorthand syntax for fragments.
|
|
3275
3280
|
* @see https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment
|
|
3276
3281
|
*/
|
|
3277
3282
|
'react-extra/jsx-shorthand-fragment'?: Linter.RuleEntry<ReactExtraJsxShorthandFragment>;
|
|
3278
3283
|
/**
|
|
3279
|
-
* Marks React variables as used when JSX is
|
|
3284
|
+
* Marks React variables as used when JSX is present.
|
|
3280
3285
|
* @see https://eslint-react.xyz/docs/rules/jsx-uses-react
|
|
3281
3286
|
*/
|
|
3282
3287
|
'react-extra/jsx-uses-react'?: Linter.RuleEntry<[]>;
|
|
@@ -3286,108 +3291,108 @@ interface RuleOptions {
|
|
|
3286
3291
|
*/
|
|
3287
3292
|
'react-extra/jsx-uses-vars'?: Linter.RuleEntry<[]>;
|
|
3288
3293
|
/**
|
|
3289
|
-
*
|
|
3294
|
+
* Disallows accessing 'this.state' inside 'setState' calls.
|
|
3290
3295
|
* @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
|
|
3291
3296
|
*/
|
|
3292
3297
|
'react-extra/no-access-state-in-setstate'?: Linter.RuleEntry<[]>;
|
|
3293
3298
|
/**
|
|
3294
|
-
*
|
|
3299
|
+
* Disallows using an item's index in the array as its key.
|
|
3295
3300
|
* @see https://eslint-react.xyz/docs/rules/no-array-index-key
|
|
3296
3301
|
*/
|
|
3297
3302
|
'react-extra/no-array-index-key'?: Linter.RuleEntry<[]>;
|
|
3298
3303
|
/**
|
|
3299
|
-
*
|
|
3304
|
+
* Disallows the use of 'Children.count' from the 'react' package.
|
|
3300
3305
|
* @see https://eslint-react.xyz/docs/rules/no-children-count
|
|
3301
3306
|
*/
|
|
3302
3307
|
'react-extra/no-children-count'?: Linter.RuleEntry<[]>;
|
|
3303
3308
|
/**
|
|
3304
|
-
*
|
|
3309
|
+
* Disallows the use of 'Children.forEach' from the 'react' package.
|
|
3305
3310
|
* @see https://eslint-react.xyz/docs/rules/no-children-for-each
|
|
3306
3311
|
*/
|
|
3307
3312
|
'react-extra/no-children-for-each'?: Linter.RuleEntry<[]>;
|
|
3308
3313
|
/**
|
|
3309
|
-
*
|
|
3314
|
+
* Disallows the use of 'Children.map' from the 'react' package.
|
|
3310
3315
|
* @see https://eslint-react.xyz/docs/rules/no-children-map
|
|
3311
3316
|
*/
|
|
3312
3317
|
'react-extra/no-children-map'?: Linter.RuleEntry<[]>;
|
|
3313
3318
|
/**
|
|
3314
|
-
*
|
|
3319
|
+
* Disallows the use of 'Children.only' from the 'react' package.
|
|
3315
3320
|
* @see https://eslint-react.xyz/docs/rules/no-children-only
|
|
3316
3321
|
*/
|
|
3317
3322
|
'react-extra/no-children-only'?: Linter.RuleEntry<[]>;
|
|
3318
3323
|
/**
|
|
3319
|
-
*
|
|
3324
|
+
* Disallows passing 'children' as a prop.
|
|
3320
3325
|
* @see https://eslint-react.xyz/docs/rules/no-children-prop
|
|
3321
3326
|
*/
|
|
3322
3327
|
'react-extra/no-children-prop'?: Linter.RuleEntry<[]>;
|
|
3323
3328
|
/**
|
|
3324
|
-
*
|
|
3329
|
+
* Disallows the use of 'Children.toArray' from the 'react' package.
|
|
3325
3330
|
* @see https://eslint-react.xyz/docs/rules/no-children-to-array
|
|
3326
3331
|
*/
|
|
3327
3332
|
'react-extra/no-children-to-array'?: Linter.RuleEntry<[]>;
|
|
3328
3333
|
/**
|
|
3329
|
-
*
|
|
3334
|
+
* Disallows class components except for error boundaries.
|
|
3330
3335
|
* @see https://eslint-react.xyz/docs/rules/no-class-component
|
|
3331
3336
|
*/
|
|
3332
3337
|
'react-extra/no-class-component'?: Linter.RuleEntry<[]>;
|
|
3333
3338
|
/**
|
|
3334
|
-
*
|
|
3339
|
+
* Disallows 'cloneElement'.
|
|
3335
3340
|
* @see https://eslint-react.xyz/docs/rules/no-clone-element
|
|
3336
3341
|
*/
|
|
3337
3342
|
'react-extra/no-clone-element'?: Linter.RuleEntry<[]>;
|
|
3338
3343
|
/**
|
|
3339
|
-
*
|
|
3344
|
+
* Replaces usage of 'componentWillMount' with 'UNSAFE_componentWillMount'.
|
|
3340
3345
|
* @see https://eslint-react.xyz/docs/rules/no-component-will-mount
|
|
3341
3346
|
*/
|
|
3342
3347
|
'react-extra/no-component-will-mount'?: Linter.RuleEntry<[]>;
|
|
3343
3348
|
/**
|
|
3344
|
-
*
|
|
3349
|
+
* Replaces usage of 'componentWillReceiveProps' with 'UNSAFE_componentWillReceiveProps'.
|
|
3345
3350
|
* @see https://eslint-react.xyz/docs/rules/no-component-will-receive-props
|
|
3346
3351
|
*/
|
|
3347
3352
|
'react-extra/no-component-will-receive-props'?: Linter.RuleEntry<[]>;
|
|
3348
3353
|
/**
|
|
3349
|
-
*
|
|
3354
|
+
* Replaces usage of 'componentWillUpdate' with 'UNSAFE_componentWillUpdate'.
|
|
3350
3355
|
* @see https://eslint-react.xyz/docs/rules/no-component-will-update
|
|
3351
3356
|
*/
|
|
3352
3357
|
'react-extra/no-component-will-update'?: Linter.RuleEntry<[]>;
|
|
3353
3358
|
/**
|
|
3354
|
-
*
|
|
3359
|
+
* Replaces usage of '<Context.Provider>' with '<Context>'.
|
|
3355
3360
|
* @see https://eslint-react.xyz/docs/rules/no-context-provider
|
|
3356
3361
|
*/
|
|
3357
3362
|
'react-extra/no-context-provider'?: Linter.RuleEntry<[]>;
|
|
3358
3363
|
/**
|
|
3359
|
-
*
|
|
3364
|
+
* Disallows 'createRef' in function components.
|
|
3360
3365
|
* @see https://eslint-react.xyz/docs/rules/no-create-ref
|
|
3361
3366
|
*/
|
|
3362
3367
|
'react-extra/no-create-ref'?: Linter.RuleEntry<[]>;
|
|
3363
3368
|
/**
|
|
3364
|
-
*
|
|
3369
|
+
* Disallows the 'defaultProps' property in favor of ES6 default parameters.
|
|
3365
3370
|
* @see https://eslint-react.xyz/docs/rules/no-default-props
|
|
3366
3371
|
*/
|
|
3367
3372
|
'react-extra/no-default-props'?: Linter.RuleEntry<[]>;
|
|
3368
3373
|
/**
|
|
3369
|
-
*
|
|
3374
|
+
* Disallows direct mutation of 'this.state'.
|
|
3370
3375
|
* @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
3371
3376
|
*/
|
|
3372
3377
|
'react-extra/no-direct-mutation-state'?: Linter.RuleEntry<[]>;
|
|
3373
3378
|
/**
|
|
3374
|
-
*
|
|
3379
|
+
* Disallows duplicate 'key' on elements in the same array or a list of 'children'.
|
|
3375
3380
|
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
3376
3381
|
*/
|
|
3377
3382
|
'react-extra/no-duplicate-key'?: Linter.RuleEntry<[]>;
|
|
3378
3383
|
/**
|
|
3379
|
-
*
|
|
3384
|
+
* Disallows certain props on components.
|
|
3380
3385
|
* @see https://eslint-react.xyz/docs/rules/no-forbidden-props
|
|
3381
3386
|
* @deprecated
|
|
3382
3387
|
*/
|
|
3383
3388
|
'react-extra/no-forbidden-props'?: Linter.RuleEntry<ReactExtraNoForbiddenProps>;
|
|
3384
3389
|
/**
|
|
3385
|
-
* Replaces
|
|
3390
|
+
* Replaces usage of 'forwardRef' with passing 'ref' as a prop.
|
|
3386
3391
|
* @see https://eslint-react.xyz/docs/rules/no-forward-ref
|
|
3387
3392
|
*/
|
|
3388
3393
|
'react-extra/no-forward-ref'?: Linter.RuleEntry<[]>;
|
|
3389
3394
|
/**
|
|
3390
|
-
* Prevents
|
|
3395
|
+
* Prevents 'key' from not being explicitly specified (e.g., spreading 'key' from objects).
|
|
3391
3396
|
* @see https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
3392
3397
|
*/
|
|
3393
3398
|
'react-extra/no-implicit-key'?: Linter.RuleEntry<[]>;
|
|
@@ -3397,57 +3402,57 @@ interface RuleOptions {
|
|
|
3397
3402
|
*/
|
|
3398
3403
|
'react-extra/no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>;
|
|
3399
3404
|
/**
|
|
3400
|
-
* Enforces that all components have a
|
|
3405
|
+
* Enforces that all components have a 'displayName' that can be used in devtools.
|
|
3401
3406
|
* @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
3402
3407
|
*/
|
|
3403
3408
|
'react-extra/no-missing-component-display-name'?: Linter.RuleEntry<[]>;
|
|
3404
3409
|
/**
|
|
3405
|
-
* Enforces that all contexts have a
|
|
3410
|
+
* Enforces that all contexts have a 'displayName' that can be used in devtools.
|
|
3406
3411
|
* @see https://eslint-react.xyz/docs/rules/no-missing-context-display-name
|
|
3407
3412
|
*/
|
|
3408
3413
|
'react-extra/no-missing-context-display-name'?: Linter.RuleEntry<[]>;
|
|
3409
3414
|
/**
|
|
3410
|
-
*
|
|
3415
|
+
* Disallows missing 'key' on items in list rendering.
|
|
3411
3416
|
* @see https://eslint-react.xyz/docs/rules/no-missing-key
|
|
3412
3417
|
*/
|
|
3413
3418
|
'react-extra/no-missing-key'?: Linter.RuleEntry<[]>;
|
|
3414
3419
|
/**
|
|
3415
|
-
* Prevents incorrect usage of
|
|
3420
|
+
* Prevents incorrect usage of 'captureOwnerStack'.
|
|
3416
3421
|
* @see https://eslint-react.xyz/docs/rules/no-misused-capture-owner-stack
|
|
3417
3422
|
*/
|
|
3418
3423
|
'react-extra/no-misused-capture-owner-stack'?: Linter.RuleEntry<[]>;
|
|
3419
3424
|
/**
|
|
3420
|
-
*
|
|
3425
|
+
* Disallows nesting component definitions inside other components.
|
|
3421
3426
|
* @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
3422
3427
|
*/
|
|
3423
3428
|
'react-extra/no-nested-component-definitions'?: Linter.RuleEntry<[]>;
|
|
3424
3429
|
/**
|
|
3425
|
-
*
|
|
3430
|
+
* Disallows nesting lazy component declarations inside other components.
|
|
3426
3431
|
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
3427
3432
|
*/
|
|
3428
3433
|
'react-extra/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
|
|
3429
3434
|
/**
|
|
3430
|
-
*
|
|
3435
|
+
* Disallows 'propTypes' in favor of TypeScript or another type-checking solution.
|
|
3431
3436
|
* @see https://eslint-react.xyz/docs/rules/no-prop-types
|
|
3432
3437
|
*/
|
|
3433
3438
|
'react-extra/no-prop-types'?: Linter.RuleEntry<[]>;
|
|
3434
3439
|
/**
|
|
3435
|
-
*
|
|
3440
|
+
* Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'.
|
|
3436
3441
|
* @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
|
|
3437
3442
|
*/
|
|
3438
3443
|
'react-extra/no-redundant-should-component-update'?: Linter.RuleEntry<[]>;
|
|
3439
3444
|
/**
|
|
3440
|
-
*
|
|
3445
|
+
* Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
|
|
3441
3446
|
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
3442
3447
|
*/
|
|
3443
3448
|
'react-extra/no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]>;
|
|
3444
3449
|
/**
|
|
3445
|
-
*
|
|
3450
|
+
* Disallows calling 'this.setState' in 'componentDidUpdate' outside functions such as callbacks.
|
|
3446
3451
|
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update
|
|
3447
3452
|
*/
|
|
3448
3453
|
'react-extra/no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>;
|
|
3449
3454
|
/**
|
|
3450
|
-
*
|
|
3455
|
+
* Disallows calling 'this.setState' in 'componentWillUpdate' outside functions such as callbacks.
|
|
3451
3456
|
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
3452
3457
|
*/
|
|
3453
3458
|
'react-extra/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
|
|
@@ -3457,42 +3462,42 @@ interface RuleOptions {
|
|
|
3457
3462
|
*/
|
|
3458
3463
|
'react-extra/no-string-refs'?: Linter.RuleEntry<[]>;
|
|
3459
3464
|
/**
|
|
3460
|
-
* Prevents
|
|
3465
|
+
* Prevents 'key' from being placed on non-top-level elements in list rendering.
|
|
3461
3466
|
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
|
|
3462
3467
|
*/
|
|
3463
3468
|
'react-extra/no-unnecessary-key'?: Linter.RuleEntry<[]>;
|
|
3464
3469
|
/**
|
|
3465
|
-
*
|
|
3470
|
+
* Disallows unnecessary usage of 'useCallback'.
|
|
3466
3471
|
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
|
|
3467
3472
|
*/
|
|
3468
3473
|
'react-extra/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
|
|
3469
3474
|
/**
|
|
3470
|
-
*
|
|
3475
|
+
* Disallows unnecessary usage of 'useMemo'.
|
|
3471
3476
|
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
|
|
3472
3477
|
*/
|
|
3473
3478
|
'react-extra/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
|
|
3474
3479
|
/**
|
|
3475
|
-
* Enforces that a function with the
|
|
3480
|
+
* Enforces that a function with the 'use' prefix uses at least one Hook inside it.
|
|
3476
3481
|
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
3477
3482
|
*/
|
|
3478
3483
|
'react-extra/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
|
|
3479
3484
|
/**
|
|
3480
|
-
* Warns the
|
|
3485
|
+
* Warns about the use of 'UNSAFE_componentWillMount' in class components.
|
|
3481
3486
|
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
3482
3487
|
*/
|
|
3483
3488
|
'react-extra/no-unsafe-component-will-mount'?: Linter.RuleEntry<[]>;
|
|
3484
3489
|
/**
|
|
3485
|
-
* Warns the
|
|
3490
|
+
* Warns about the use of 'UNSAFE_componentWillReceiveProps' in class components.
|
|
3486
3491
|
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props
|
|
3487
3492
|
*/
|
|
3488
3493
|
'react-extra/no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]>;
|
|
3489
3494
|
/**
|
|
3490
|
-
* Warns the
|
|
3495
|
+
* Warns about the use of 'UNSAFE_componentWillUpdate' in class components.
|
|
3491
3496
|
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update
|
|
3492
3497
|
*/
|
|
3493
3498
|
'react-extra/no-unsafe-component-will-update'?: Linter.RuleEntry<[]>;
|
|
3494
3499
|
/**
|
|
3495
|
-
* Prevents non-stable values (i.e
|
|
3500
|
+
* Prevents non-stable values (i.e., object literals) from being used as a value for 'Context.Provider'.
|
|
3496
3501
|
* @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
|
|
3497
3502
|
*/
|
|
3498
3503
|
'react-extra/no-unstable-context-value'?: Linter.RuleEntry<[]>;
|
|
@@ -3502,32 +3507,32 @@ interface RuleOptions {
|
|
|
3502
3507
|
*/
|
|
3503
3508
|
'react-extra/no-unstable-default-props'?: Linter.RuleEntry<ReactExtraNoUnstableDefaultProps>;
|
|
3504
3509
|
/**
|
|
3505
|
-
* Warns unused class component methods and properties.
|
|
3510
|
+
* Warns about unused class component methods and properties.
|
|
3506
3511
|
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
3507
3512
|
*/
|
|
3508
3513
|
'react-extra/no-unused-class-component-members'?: Linter.RuleEntry<[]>;
|
|
3509
3514
|
/**
|
|
3510
|
-
* Warns component props that are defined but never used.
|
|
3515
|
+
* Warns about component props that are defined but never used.
|
|
3511
3516
|
* @see https://eslint-react.xyz/docs/rules/no-unused-props
|
|
3512
3517
|
*/
|
|
3513
3518
|
'react-extra/no-unused-props'?: Linter.RuleEntry<[]>;
|
|
3514
3519
|
/**
|
|
3515
|
-
* Warns unused class component state.
|
|
3520
|
+
* Warns about unused class component state.
|
|
3516
3521
|
* @see https://eslint-react.xyz/docs/rules/no-unused-state
|
|
3517
3522
|
*/
|
|
3518
3523
|
'react-extra/no-unused-state'?: Linter.RuleEntry<[]>;
|
|
3519
3524
|
/**
|
|
3520
|
-
* Replaces
|
|
3525
|
+
* Replaces usage of 'useContext' with 'use'.
|
|
3521
3526
|
* @see https://eslint-react.xyz/docs/rules/no-use-context
|
|
3522
3527
|
*/
|
|
3523
3528
|
'react-extra/no-use-context'?: Linter.RuleEntry<[]>;
|
|
3524
3529
|
/**
|
|
3525
|
-
*
|
|
3530
|
+
* Disallows useless 'forwardRef' calls on components that don't use 'ref's.
|
|
3526
3531
|
* @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref
|
|
3527
3532
|
*/
|
|
3528
3533
|
'react-extra/no-useless-forward-ref'?: Linter.RuleEntry<[]>;
|
|
3529
3534
|
/**
|
|
3530
|
-
*
|
|
3535
|
+
* Disallows useless fragment elements.
|
|
3531
3536
|
* @see https://eslint-react.xyz/docs/rules/no-useless-fragment
|
|
3532
3537
|
*/
|
|
3533
3538
|
'react-extra/no-useless-fragment'?: Linter.RuleEntry<ReactExtraNoUselessFragment>;
|
|
@@ -3537,7 +3542,7 @@ interface RuleOptions {
|
|
|
3537
3542
|
*/
|
|
3538
3543
|
'react-extra/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>;
|
|
3539
3544
|
/**
|
|
3540
|
-
* Enforces React
|
|
3545
|
+
* Enforces importing React via a namespace import.
|
|
3541
3546
|
* @see https://eslint-react.xyz/docs/rules/prefer-namespace-import
|
|
3542
3547
|
*/
|
|
3543
3548
|
'react-extra/prefer-namespace-import'?: Linter.RuleEntry<[]>;
|
|
@@ -3547,12 +3552,12 @@ interface RuleOptions {
|
|
|
3547
3552
|
*/
|
|
3548
3553
|
'react-extra/prefer-read-only-props'?: Linter.RuleEntry<[]>;
|
|
3549
3554
|
/**
|
|
3550
|
-
* Enforces function calls made inside
|
|
3555
|
+
* Enforces wrapping function calls made inside 'useState' in an 'initializer function'.
|
|
3551
3556
|
* @see https://eslint-react.xyz/docs/rules/prefer-use-state-lazy-initialization
|
|
3552
3557
|
*/
|
|
3553
3558
|
'react-extra/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>;
|
|
3554
3559
|
/**
|
|
3555
|
-
*
|
|
3560
|
+
* Disallows **direct** calls to the 'set' function of 'useState' in 'useEffect'.
|
|
3556
3561
|
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
|
|
3557
3562
|
*/
|
|
3558
3563
|
'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>;
|
|
@@ -3680,7 +3685,7 @@ interface RuleOptions {
|
|
|
3680
3685
|
*/
|
|
3681
3686
|
'react-naming-convention/component-name'?: Linter.RuleEntry<ReactNamingConventionComponentName>;
|
|
3682
3687
|
/**
|
|
3683
|
-
* Enforces context name to be a valid component name with the suffix
|
|
3688
|
+
* Enforces the context name to be a valid component name with the suffix 'Context'.
|
|
3684
3689
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
|
|
3685
3690
|
*/
|
|
3686
3691
|
'react-naming-convention/context-name'?: Linter.RuleEntry<[]>;
|
|
@@ -3690,32 +3695,37 @@ interface RuleOptions {
|
|
|
3690
3695
|
*/
|
|
3691
3696
|
'react-naming-convention/filename'?: Linter.RuleEntry<ReactNamingConventionFilename>;
|
|
3692
3697
|
/**
|
|
3693
|
-
* Enforces consistent file
|
|
3698
|
+
* Enforces consistent use of the JSX file extension.
|
|
3694
3699
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-filename-extension
|
|
3695
3700
|
*/
|
|
3696
3701
|
'react-naming-convention/filename-extension'?: Linter.RuleEntry<ReactNamingConventionFilenameExtension>;
|
|
3697
3702
|
/**
|
|
3698
|
-
* Enforces
|
|
3703
|
+
* Enforces that variables assigned from useRef calls have names ending with 'Ref'.
|
|
3704
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-ref-name
|
|
3705
|
+
*/
|
|
3706
|
+
'react-naming-convention/ref-name'?: Linter.RuleEntry<[]>;
|
|
3707
|
+
/**
|
|
3708
|
+
* Enforces destructuring and symmetric naming of the 'useState' hook value and setter.
|
|
3699
3709
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-use-state
|
|
3700
3710
|
*/
|
|
3701
3711
|
'react-naming-convention/use-state'?: Linter.RuleEntry<ReactNamingConventionUseState>;
|
|
3702
3712
|
/**
|
|
3703
|
-
*
|
|
3713
|
+
* Enforces that every 'addEventListener' in a component or custom hook has a corresponding 'removeEventListener'.
|
|
3704
3714
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
|
|
3705
3715
|
*/
|
|
3706
3716
|
'react-web-api/no-leaked-event-listener'?: Linter.RuleEntry<[]>;
|
|
3707
3717
|
/**
|
|
3708
|
-
*
|
|
3718
|
+
* Enforces that every 'setInterval' in a component or custom hook has a corresponding 'clearInterval'.
|
|
3709
3719
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
|
|
3710
3720
|
*/
|
|
3711
3721
|
'react-web-api/no-leaked-interval'?: Linter.RuleEntry<[]>;
|
|
3712
3722
|
/**
|
|
3713
|
-
*
|
|
3723
|
+
* Enforces that every 'ResizeObserver' created in a component or custom hook has a corresponding 'ResizeObserver.disconnect()'.
|
|
3714
3724
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
|
|
3715
3725
|
*/
|
|
3716
3726
|
'react-web-api/no-leaked-resize-observer'?: Linter.RuleEntry<[]>;
|
|
3717
3727
|
/**
|
|
3718
|
-
*
|
|
3728
|
+
* Enforces that every 'setTimeout' in a component or custom hook has a corresponding 'clearTimeout'.
|
|
3719
3729
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
|
|
3720
3730
|
*/
|
|
3721
3731
|
'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>;
|