@bfra.me/eslint-config 0.32.3 → 0.34.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/lib/index.d.ts +349 -100
- package/lib/index.js +14 -11
- package/lib/{missing-module-for-config-YSY2AGPQ.js → missing-module-for-config-YQFEGW2J.js} +1 -1
- package/package.json +21 -21
- package/src/config.d.ts +2 -1
- package/src/configs/nextjs.ts +10 -3
- package/src/configs/react.ts +5 -5
- package/src/configs/sort.ts +1 -0
- package/src/configs/typescript.ts +0 -1
- package/src/plugins.d.ts +8 -25
- package/src/rules/missing-module-for-config.ts +4 -3
- package/src/rules.d.ts +347 -99
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as eslint_flat_config_utils from 'eslint-flat-config-utils';
|
|
2
2
|
import { ResolvableFlatConfig, FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
3
3
|
export { FlatConfigComposer, ResolvableFlatConfig } from 'eslint-flat-config-utils';
|
|
4
|
+
import { RulesConfig } from '@eslint/core';
|
|
4
5
|
import { Linter } from 'eslint';
|
|
5
6
|
import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
|
|
6
7
|
import { ParserOptions } from '@typescript-eslint/types';
|
|
@@ -191,6 +192,11 @@ interface Rules {
|
|
|
191
192
|
* @see https://eslint.style/rules/eol-last
|
|
192
193
|
*/
|
|
193
194
|
'@stylistic/eol-last'?: Linter.RuleEntry<StylisticEolLast>
|
|
195
|
+
/**
|
|
196
|
+
* Enforce consistent spacing and line break styles inside brackets.
|
|
197
|
+
* @see https://eslint.style/rules/list-style
|
|
198
|
+
*/
|
|
199
|
+
'@stylistic/exp-list-style'?: Linter.RuleEntry<StylisticExpListStyle>
|
|
194
200
|
/**
|
|
195
201
|
* Enforce line breaks between arguments of a function call
|
|
196
202
|
* @see https://eslint.style/rules/function-call-argument-newline
|
|
@@ -3692,6 +3698,11 @@ interface Rules {
|
|
|
3692
3698
|
* @see https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/prefer-tilde-range-version.html
|
|
3693
3699
|
*/
|
|
3694
3700
|
'node-dependencies/prefer-tilde-range-version'?: Linter.RuleEntry<[]>
|
|
3701
|
+
/**
|
|
3702
|
+
* Require provenance information for dependencies
|
|
3703
|
+
* @see https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/require-provenance-deps.html
|
|
3704
|
+
*/
|
|
3705
|
+
'node-dependencies/require-provenance-deps'?: Linter.RuleEntry<NodeDependenciesRequireProvenanceDeps>
|
|
3695
3706
|
/**
|
|
3696
3707
|
* enforce the versions of the engines of the dependencies to be compatible.
|
|
3697
3708
|
* @see https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/valid-engines.html
|
|
@@ -4200,11 +4211,6 @@ interface Rules {
|
|
|
4200
4211
|
* @see https://eslint.org/docs/latest/rules/radix
|
|
4201
4212
|
*/
|
|
4202
4213
|
'radix'?: Linter.RuleEntry<Radix>
|
|
4203
|
-
/**
|
|
4204
|
-
* Disallow `children` in void DOM elements.
|
|
4205
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
4206
|
-
*/
|
|
4207
|
-
'react-dom/no-children-in-void-dom-elements'?: Linter.RuleEntry<[]>
|
|
4208
4214
|
/**
|
|
4209
4215
|
* Disallow `dangerouslySetInnerHTML`.
|
|
4210
4216
|
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
@@ -4260,6 +4266,11 @@ interface Rules {
|
|
|
4260
4266
|
* @see https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
4261
4267
|
*/
|
|
4262
4268
|
'react-dom/no-script-url'?: Linter.RuleEntry<[]>
|
|
4269
|
+
/**
|
|
4270
|
+
* Disallows the use of string style prop.
|
|
4271
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
4272
|
+
*/
|
|
4273
|
+
'react-dom/no-string-style-prop'?: Linter.RuleEntry<[]>
|
|
4263
4274
|
/**
|
|
4264
4275
|
* Disallow unknown `DOM` property.
|
|
4265
4276
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
@@ -4286,70 +4297,128 @@ interface Rules {
|
|
|
4286
4297
|
*/
|
|
4287
4298
|
'react-dom/no-void-elements-with-children'?: Linter.RuleEntry<[]>
|
|
4288
4299
|
/**
|
|
4289
|
-
*
|
|
4290
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-
|
|
4300
|
+
* Disallow direct calls to the `set` function of `useState` in `useEffect`.
|
|
4301
|
+
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
|
|
4291
4302
|
*/
|
|
4292
|
-
'react-hooks-extra/
|
|
4303
|
+
'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>
|
|
4293
4304
|
/**
|
|
4294
|
-
*
|
|
4295
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-callback
|
|
4305
|
+
* Verifies that automatic effect dependencies are compiled if opted-in
|
|
4296
4306
|
*/
|
|
4297
|
-
'react-hooks
|
|
4307
|
+
'react-hooks/automatic-effect-dependencies'?: Linter.RuleEntry<ReactHooksAutomaticEffectDependencies>
|
|
4298
4308
|
/**
|
|
4299
|
-
*
|
|
4300
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-memo
|
|
4309
|
+
* Validates against calling capitalized functions/methods instead of using JSX
|
|
4301
4310
|
*/
|
|
4302
|
-
'react-hooks
|
|
4311
|
+
'react-hooks/capitalized-calls'?: Linter.RuleEntry<ReactHooksCapitalizedCalls>
|
|
4303
4312
|
/**
|
|
4304
|
-
*
|
|
4305
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
|
|
4313
|
+
* Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level
|
|
4306
4314
|
*/
|
|
4307
|
-
'react-hooks
|
|
4315
|
+
'react-hooks/component-hook-factories'?: Linter.RuleEntry<ReactHooksComponentHookFactories>
|
|
4308
4316
|
/**
|
|
4309
|
-
*
|
|
4310
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-layout-effect
|
|
4317
|
+
* Validates the compiler configuration options
|
|
4311
4318
|
*/
|
|
4312
|
-
'react-hooks
|
|
4319
|
+
'react-hooks/config'?: Linter.RuleEntry<ReactHooksConfig>
|
|
4313
4320
|
/**
|
|
4314
|
-
*
|
|
4315
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
|
|
4321
|
+
* Validates usage of error boundaries instead of try/catch for errors in child components
|
|
4316
4322
|
*/
|
|
4317
|
-
'react-hooks
|
|
4323
|
+
'react-hooks/error-boundaries'?: Linter.RuleEntry<ReactHooksErrorBoundaries>
|
|
4318
4324
|
/**
|
|
4319
|
-
*
|
|
4320
|
-
* @see https://
|
|
4325
|
+
* verifies the list of dependencies for Hooks like useEffect and similar
|
|
4326
|
+
* @see https://github.com/facebook/react/issues/14920
|
|
4321
4327
|
*/
|
|
4322
|
-
'react-hooks
|
|
4328
|
+
'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>
|
|
4323
4329
|
/**
|
|
4324
|
-
*
|
|
4325
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-memo
|
|
4330
|
+
* Validates usage of fbt
|
|
4326
4331
|
*/
|
|
4327
|
-
'react-hooks
|
|
4332
|
+
'react-hooks/fbt'?: Linter.RuleEntry<ReactHooksFbt>
|
|
4328
4333
|
/**
|
|
4329
|
-
*
|
|
4330
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
|
|
4334
|
+
* Validates usage of `fire`
|
|
4331
4335
|
*/
|
|
4332
|
-
'react-hooks
|
|
4336
|
+
'react-hooks/fire'?: Linter.RuleEntry<ReactHooksFire>
|
|
4333
4337
|
/**
|
|
4334
|
-
*
|
|
4335
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
|
|
4338
|
+
* Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)
|
|
4336
4339
|
*/
|
|
4337
|
-
'react-hooks
|
|
4340
|
+
'react-hooks/gating'?: Linter.RuleEntry<ReactHooksGating>
|
|
4338
4341
|
/**
|
|
4339
|
-
*
|
|
4340
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-prefer-use-state-lazy-initialization
|
|
4342
|
+
* Validates against assignment/mutation of globals during render, part of ensuring that [side effects must render outside of render](https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)
|
|
4341
4343
|
*/
|
|
4342
|
-
'react-hooks
|
|
4344
|
+
'react-hooks/globals'?: Linter.RuleEntry<ReactHooksGlobals>
|
|
4343
4345
|
/**
|
|
4344
|
-
*
|
|
4345
|
-
* @see https://github.com/facebook/react/issues/14920
|
|
4346
|
+
* Validates the rules of hooks
|
|
4346
4347
|
*/
|
|
4347
|
-
'react-hooks/
|
|
4348
|
+
'react-hooks/hooks'?: Linter.RuleEntry<ReactHooksHooks>
|
|
4349
|
+
/**
|
|
4350
|
+
* Validates against mutating props, state, and other values that [are immutable](https://react.dev/reference/rules/components-and-hooks-must-be-pure#props-and-state-are-immutable)
|
|
4351
|
+
*/
|
|
4352
|
+
'react-hooks/immutability'?: Linter.RuleEntry<ReactHooksImmutability>
|
|
4353
|
+
/**
|
|
4354
|
+
* Validates against usage of libraries which are incompatible with memoization (manual or automatic)
|
|
4355
|
+
*/
|
|
4356
|
+
'react-hooks/incompatible-library'?: Linter.RuleEntry<ReactHooksIncompatibleLibrary>
|
|
4357
|
+
/**
|
|
4358
|
+
* Internal invariants
|
|
4359
|
+
*/
|
|
4360
|
+
'react-hooks/invariant'?: Linter.RuleEntry<ReactHooksInvariant>
|
|
4361
|
+
/**
|
|
4362
|
+
* Validates that effect dependencies are memoized
|
|
4363
|
+
*/
|
|
4364
|
+
'react-hooks/memoized-effect-dependencies'?: Linter.RuleEntry<ReactHooksMemoizedEffectDependencies>
|
|
4365
|
+
/**
|
|
4366
|
+
* Validates against deriving values from state in an effect
|
|
4367
|
+
*/
|
|
4368
|
+
'react-hooks/no-deriving-state-in-effects'?: Linter.RuleEntry<ReactHooksNoDerivingStateInEffects>
|
|
4369
|
+
/**
|
|
4370
|
+
* Validates that existing manual memoized is preserved by the compiler. React Compiler will only compile components and hooks if its inference [matches or exceeds the existing manual memoization](https://react.dev/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo)
|
|
4371
|
+
*/
|
|
4372
|
+
'react-hooks/preserve-manual-memoization'?: Linter.RuleEntry<ReactHooksPreserveManualMemoization>
|
|
4373
|
+
/**
|
|
4374
|
+
* Validates that [components/hooks are pure](https://react.dev/reference/rules/components-and-hooks-must-be-pure) by checking that they do not call known-impure functions
|
|
4375
|
+
*/
|
|
4376
|
+
'react-hooks/purity'?: Linter.RuleEntry<ReactHooksPurity>
|
|
4377
|
+
/**
|
|
4378
|
+
* Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
|
|
4379
|
+
*/
|
|
4380
|
+
'react-hooks/refs'?: Linter.RuleEntry<ReactHooksRefs>
|
|
4381
|
+
/**
|
|
4382
|
+
* Validates against suppression of other rules
|
|
4383
|
+
*/
|
|
4384
|
+
'react-hooks/rule-suppression'?: Linter.RuleEntry<ReactHooksRuleSuppression>
|
|
4348
4385
|
/**
|
|
4349
4386
|
* enforces the Rules of Hooks
|
|
4350
|
-
* @see https://
|
|
4387
|
+
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
4351
4388
|
*/
|
|
4352
|
-
'react-hooks/rules-of-hooks'?: Linter.RuleEntry<
|
|
4389
|
+
'react-hooks/rules-of-hooks'?: Linter.RuleEntry<ReactHooksRulesOfHooks>
|
|
4390
|
+
/**
|
|
4391
|
+
* Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
|
|
4392
|
+
*/
|
|
4393
|
+
'react-hooks/set-state-in-effect'?: Linter.RuleEntry<ReactHooksSetStateInEffect>
|
|
4394
|
+
/**
|
|
4395
|
+
* Validates against setting state during render, which can trigger additional renders and potential infinite render loops
|
|
4396
|
+
*/
|
|
4397
|
+
'react-hooks/set-state-in-render'?: Linter.RuleEntry<ReactHooksSetStateInRender>
|
|
4398
|
+
/**
|
|
4399
|
+
* Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
|
|
4400
|
+
*/
|
|
4401
|
+
'react-hooks/static-components'?: Linter.RuleEntry<ReactHooksStaticComponents>
|
|
4402
|
+
/**
|
|
4403
|
+
* Validates against invalid syntax
|
|
4404
|
+
*/
|
|
4405
|
+
'react-hooks/syntax'?: Linter.RuleEntry<ReactHooksSyntax>
|
|
4406
|
+
/**
|
|
4407
|
+
* Unimplemented features
|
|
4408
|
+
*/
|
|
4409
|
+
'react-hooks/todo'?: Linter.RuleEntry<ReactHooksTodo>
|
|
4410
|
+
/**
|
|
4411
|
+
* Validates against syntax that we do not plan to support in React Compiler
|
|
4412
|
+
*/
|
|
4413
|
+
'react-hooks/unsupported-syntax'?: Linter.RuleEntry<ReactHooksUnsupportedSyntax>
|
|
4414
|
+
/**
|
|
4415
|
+
* Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
4416
|
+
*/
|
|
4417
|
+
'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>
|
|
4418
|
+
/**
|
|
4419
|
+
* Validates that useMemos always return a value. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
4420
|
+
*/
|
|
4421
|
+
'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>
|
|
4353
4422
|
/**
|
|
4354
4423
|
* Enforces naming conventions for components.
|
|
4355
4424
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-component-name
|
|
@@ -4396,26 +4465,16 @@ interface Rules {
|
|
|
4396
4465
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
|
|
4397
4466
|
*/
|
|
4398
4467
|
'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>
|
|
4399
|
-
/**
|
|
4400
|
-
* Enforces explicit boolean values for boolean attributes.
|
|
4401
|
-
* @see https://eslint-react.xyz/docs/rules/avoid-shorthand-boolean
|
|
4402
|
-
*/
|
|
4403
|
-
'react/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>
|
|
4404
|
-
/**
|
|
4405
|
-
* Enforces explicit `<Fragment>` components instead of the shorthand `<>` or `</>` syntax.
|
|
4406
|
-
* @see https://eslint-react.xyz/docs/rules/avoid-shorthand-fragment
|
|
4407
|
-
*/
|
|
4408
|
-
'react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>
|
|
4409
|
-
/**
|
|
4410
|
-
* Disallow useless `forwardRef` calls on components that don't use `ref`s.
|
|
4411
|
-
* @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref
|
|
4412
|
-
*/
|
|
4413
|
-
'react/ensure-forward-ref-using-ref'?: Linter.RuleEntry<[]>
|
|
4414
4468
|
/**
|
|
4415
4469
|
* Enforces that the 'key' attribute is placed before the spread attribute in JSX elements.
|
|
4416
4470
|
* @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread
|
|
4417
4471
|
*/
|
|
4418
4472
|
'react/jsx-key-before-spread'?: Linter.RuleEntry<[]>
|
|
4473
|
+
/**
|
|
4474
|
+
* Prevents comments from being inserted as text nodes.
|
|
4475
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
|
|
4476
|
+
*/
|
|
4477
|
+
'react/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>
|
|
4419
4478
|
/**
|
|
4420
4479
|
* Disallow duplicate props in JSX elements.
|
|
4421
4480
|
* @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
|
|
@@ -4431,6 +4490,16 @@ interface Rules {
|
|
|
4431
4490
|
* @see https://eslint-react.xyz/docs/rules/jsx-no-undef
|
|
4432
4491
|
*/
|
|
4433
4492
|
'react/jsx-no-undef'?: Linter.RuleEntry<[]>
|
|
4493
|
+
/**
|
|
4494
|
+
* Enforces shorthand syntax for boolean attributes.
|
|
4495
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean
|
|
4496
|
+
*/
|
|
4497
|
+
'react/jsx-shorthand-boolean'?: Linter.RuleEntry<ReactJsxShorthandBoolean>
|
|
4498
|
+
/**
|
|
4499
|
+
* Enforces shorthand syntax for fragments.
|
|
4500
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment
|
|
4501
|
+
*/
|
|
4502
|
+
'react/jsx-shorthand-fragment'?: Linter.RuleEntry<ReactJsxShorthandFragment>
|
|
4434
4503
|
/**
|
|
4435
4504
|
* Marks React variables as used when JSX is used.
|
|
4436
4505
|
* @see https://eslint-react.xyz/docs/rules/jsx-uses-react
|
|
@@ -4491,21 +4560,6 @@ interface Rules {
|
|
|
4491
4560
|
* @see https://eslint-react.xyz/docs/rules/no-clone-element
|
|
4492
4561
|
*/
|
|
4493
4562
|
'react/no-clone-element'?: Linter.RuleEntry<[]>
|
|
4494
|
-
/**
|
|
4495
|
-
* Prevents comments from being inserted as text nodes.
|
|
4496
|
-
* @see https://eslint-react.xyz/docs/rules/no-comment-textnodes
|
|
4497
|
-
*/
|
|
4498
|
-
'react/no-comment-textnodes'?: Linter.RuleEntry<[]>
|
|
4499
|
-
/**
|
|
4500
|
-
* Disallow complex conditional rendering in JSX expressions.
|
|
4501
|
-
* @see https://eslint-react.xyz/docs/rules/no-complex-conditional-rendering
|
|
4502
|
-
*/
|
|
4503
|
-
'react/no-complex-conditional-rendering'?: Linter.RuleEntry<[]>
|
|
4504
|
-
/**
|
|
4505
|
-
* Disallow complex conditional rendering in JSX expressions.
|
|
4506
|
-
* @see https://eslint-react.xyz/docs/rules/no-complex-conditional-rendering
|
|
4507
|
-
*/
|
|
4508
|
-
'react/no-complicated-conditional-rendering'?: Linter.RuleEntry<[]>
|
|
4509
4563
|
/**
|
|
4510
4564
|
* Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`.
|
|
4511
4565
|
* @see https://eslint-react.xyz/docs/rules/no-component-will-mount
|
|
@@ -4541,16 +4595,16 @@ interface Rules {
|
|
|
4541
4595
|
* @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
4542
4596
|
*/
|
|
4543
4597
|
'react/no-direct-mutation-state'?: Linter.RuleEntry<[]>
|
|
4544
|
-
/**
|
|
4545
|
-
* Disallow duplicate props in JSX elements.
|
|
4546
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
|
|
4547
|
-
*/
|
|
4548
|
-
'react/no-duplicate-jsx-props'?: Linter.RuleEntry<[]>
|
|
4549
4598
|
/**
|
|
4550
4599
|
* Disallow duplicate `key` on elements in the same array or a list of `children`.
|
|
4551
4600
|
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
4552
4601
|
*/
|
|
4553
4602
|
'react/no-duplicate-key'?: Linter.RuleEntry<[]>
|
|
4603
|
+
/**
|
|
4604
|
+
* Disallow certain props on components.
|
|
4605
|
+
* @see https://eslint-react.xyz/docs/rules/no-forbidden-props
|
|
4606
|
+
*/
|
|
4607
|
+
'react/no-forbidden-props'?: Linter.RuleEntry<ReactNoForbiddenProps>
|
|
4554
4608
|
/**
|
|
4555
4609
|
* Replaces usages of `forwardRef` with passing `ref` as a prop.
|
|
4556
4610
|
* @see https://eslint-react.xyz/docs/rules/no-forward-ref
|
|
@@ -4591,11 +4645,6 @@ interface Rules {
|
|
|
4591
4645
|
* @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
4592
4646
|
*/
|
|
4593
4647
|
'react/no-nested-component-definitions'?: Linter.RuleEntry<[]>
|
|
4594
|
-
/**
|
|
4595
|
-
* Disallow nesting component definitions inside other components.
|
|
4596
|
-
* @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
4597
|
-
*/
|
|
4598
|
-
'react/no-nested-components'?: Linter.RuleEntry<[]>
|
|
4599
4648
|
/**
|
|
4600
4649
|
* Disallow nesting lazy component declarations inside other components.
|
|
4601
4650
|
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
@@ -4631,6 +4680,26 @@ interface Rules {
|
|
|
4631
4680
|
* @see https://eslint-react.xyz/docs/rules/no-string-refs
|
|
4632
4681
|
*/
|
|
4633
4682
|
'react/no-string-refs'?: Linter.RuleEntry<[]>
|
|
4683
|
+
/**
|
|
4684
|
+
* Prevents the use of unnecessary `key` props on JSX elements when rendering lists.
|
|
4685
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
|
|
4686
|
+
*/
|
|
4687
|
+
'react/no-unnecessary-key'?: Linter.RuleEntry<[]>
|
|
4688
|
+
/**
|
|
4689
|
+
* Disallow unnecessary usage of `useCallback`.
|
|
4690
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
|
|
4691
|
+
*/
|
|
4692
|
+
'react/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>
|
|
4693
|
+
/**
|
|
4694
|
+
* Disallow unnecessary usage of `useMemo`.
|
|
4695
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
|
|
4696
|
+
*/
|
|
4697
|
+
'react/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>
|
|
4698
|
+
/**
|
|
4699
|
+
* Enforces that a function with the `use` prefix should use at least one Hook inside of it.
|
|
4700
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
4701
|
+
*/
|
|
4702
|
+
'react/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>
|
|
4634
4703
|
/**
|
|
4635
4704
|
* Warns the usage of `UNSAFE_componentWillMount` in class components.
|
|
4636
4705
|
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
@@ -4661,6 +4730,11 @@ interface Rules {
|
|
|
4661
4730
|
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
4662
4731
|
*/
|
|
4663
4732
|
'react/no-unused-class-component-members'?: Linter.RuleEntry<[]>
|
|
4733
|
+
/**
|
|
4734
|
+
* Warns about unused component prop declarations.
|
|
4735
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-props
|
|
4736
|
+
*/
|
|
4737
|
+
'react/no-unused-props'?: Linter.RuleEntry<[]>
|
|
4664
4738
|
/**
|
|
4665
4739
|
* Warns unused class component state.
|
|
4666
4740
|
* @see https://eslint-react.xyz/docs/rules/no-unused-state
|
|
@@ -4688,29 +4762,19 @@ interface Rules {
|
|
|
4688
4762
|
'react/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>
|
|
4689
4763
|
/**
|
|
4690
4764
|
* Enforces React is imported via a namespace import.
|
|
4691
|
-
* @see https://eslint-react.xyz/docs/rules/prefer-
|
|
4765
|
+
* @see https://eslint-react.xyz/docs/rules/prefer-namespace-import
|
|
4692
4766
|
*/
|
|
4693
|
-
'react/prefer-
|
|
4767
|
+
'react/prefer-namespace-import'?: Linter.RuleEntry<[]>
|
|
4694
4768
|
/**
|
|
4695
4769
|
* Enforces read-only props in components.
|
|
4696
4770
|
* @see https://eslint-react.xyz/docs/rules/prefer-read-only-props
|
|
4697
4771
|
*/
|
|
4698
4772
|
'react/prefer-read-only-props'?: Linter.RuleEntry<[]>
|
|
4699
4773
|
/**
|
|
4700
|
-
* Enforces
|
|
4701
|
-
* @see https://eslint-react.xyz/docs/rules/prefer-
|
|
4702
|
-
*/
|
|
4703
|
-
'react/prefer-shorthand-boolean'?: Linter.RuleEntry<[]>
|
|
4704
|
-
/**
|
|
4705
|
-
* Enforces shorthand syntax for fragments.
|
|
4706
|
-
* @see https://eslint-react.xyz/docs/rules/prefer-shorthand-fragment
|
|
4707
|
-
*/
|
|
4708
|
-
'react/prefer-shorthand-fragment'?: Linter.RuleEntry<[]>
|
|
4709
|
-
/**
|
|
4710
|
-
* Marks variables used in JSX elements as used.
|
|
4711
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-uses-vars
|
|
4774
|
+
* Enforces function calls made inside `useState` to be wrapped in an `initializer function`.
|
|
4775
|
+
* @see https://eslint-react.xyz/docs/rules/prefer-use-state-lazy-initialization
|
|
4712
4776
|
*/
|
|
4713
|
-
'react/use-
|
|
4777
|
+
'react/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>
|
|
4714
4778
|
/**
|
|
4715
4779
|
* disallow confusing quantifiers
|
|
4716
4780
|
* @see https://ota-meshi.github.io/eslint-plugin-regexp/rules/confusing-quantifier.html
|
|
@@ -6820,6 +6884,50 @@ type StylisticCurlyNewline = []|[(("always" | "never") | {
|
|
|
6820
6884
|
type StylisticDotLocation = []|[("object" | "property")]
|
|
6821
6885
|
// ----- @stylistic/eol-last -----
|
|
6822
6886
|
type StylisticEolLast = []|[("always" | "never" | "unix" | "windows")]
|
|
6887
|
+
// ----- @stylistic/exp-list-style -----
|
|
6888
|
+
type StylisticExpListStyle = []|[{
|
|
6889
|
+
singleLine?: _StylisticExpListStyle_SingleLineConfig
|
|
6890
|
+
multiLine?: _StylisticExpListStyle_MultiLineConfig
|
|
6891
|
+
overrides?: {
|
|
6892
|
+
"[]"?: _StylisticExpListStyle_BaseConfig
|
|
6893
|
+
"{}"?: _StylisticExpListStyle_BaseConfig
|
|
6894
|
+
"<>"?: _StylisticExpListStyle_BaseConfig
|
|
6895
|
+
"()"?: _StylisticExpListStyle_BaseConfig
|
|
6896
|
+
ArrayExpression?: _StylisticExpListStyle_BaseConfig
|
|
6897
|
+
ArrayPattern?: _StylisticExpListStyle_BaseConfig
|
|
6898
|
+
ArrowFunctionExpression?: _StylisticExpListStyle_BaseConfig
|
|
6899
|
+
CallExpression?: _StylisticExpListStyle_BaseConfig
|
|
6900
|
+
ExportNamedDeclaration?: _StylisticExpListStyle_BaseConfig
|
|
6901
|
+
FunctionDeclaration?: _StylisticExpListStyle_BaseConfig
|
|
6902
|
+
FunctionExpression?: _StylisticExpListStyle_BaseConfig
|
|
6903
|
+
ImportDeclaration?: _StylisticExpListStyle_BaseConfig
|
|
6904
|
+
ImportAttributes?: _StylisticExpListStyle_BaseConfig
|
|
6905
|
+
NewExpression?: _StylisticExpListStyle_BaseConfig
|
|
6906
|
+
ObjectExpression?: _StylisticExpListStyle_BaseConfig
|
|
6907
|
+
ObjectPattern?: _StylisticExpListStyle_BaseConfig
|
|
6908
|
+
TSDeclareFunction?: _StylisticExpListStyle_BaseConfig
|
|
6909
|
+
TSFunctionType?: _StylisticExpListStyle_BaseConfig
|
|
6910
|
+
TSInterfaceBody?: _StylisticExpListStyle_BaseConfig
|
|
6911
|
+
TSEnumBody?: _StylisticExpListStyle_BaseConfig
|
|
6912
|
+
TSTupleType?: _StylisticExpListStyle_BaseConfig
|
|
6913
|
+
TSTypeLiteral?: _StylisticExpListStyle_BaseConfig
|
|
6914
|
+
TSTypeParameterDeclaration?: _StylisticExpListStyle_BaseConfig
|
|
6915
|
+
TSTypeParameterInstantiation?: _StylisticExpListStyle_BaseConfig
|
|
6916
|
+
JSONArrayExpression?: _StylisticExpListStyle_BaseConfig
|
|
6917
|
+
JSONObjectExpression?: _StylisticExpListStyle_BaseConfig
|
|
6918
|
+
}
|
|
6919
|
+
}]
|
|
6920
|
+
interface _StylisticExpListStyle_SingleLineConfig {
|
|
6921
|
+
spacing?: ("always" | "never")
|
|
6922
|
+
maxItems?: number
|
|
6923
|
+
}
|
|
6924
|
+
interface _StylisticExpListStyle_MultiLineConfig {
|
|
6925
|
+
minItems?: number
|
|
6926
|
+
}
|
|
6927
|
+
interface _StylisticExpListStyle_BaseConfig {
|
|
6928
|
+
singleLine?: _StylisticExpListStyle_SingleLineConfig
|
|
6929
|
+
multiline?: _StylisticExpListStyle_MultiLineConfig
|
|
6930
|
+
}
|
|
6823
6931
|
// ----- @stylistic/function-call-argument-newline -----
|
|
6824
6932
|
type StylisticFunctionCallArgumentNewline = []|[("always" | "never" | "consistent")]
|
|
6825
6933
|
// ----- @stylistic/function-call-spacing -----
|
|
@@ -6889,7 +6997,11 @@ type StylisticIndent = []|[("tab" | number)]|[("tab" | number), {
|
|
|
6889
6997
|
ObjectExpression?: (number | ("first" | "off"))
|
|
6890
6998
|
ImportDeclaration?: (number | ("first" | "off"))
|
|
6891
6999
|
flatTernaryExpressions?: boolean
|
|
6892
|
-
offsetTernaryExpressions?: boolean
|
|
7000
|
+
offsetTernaryExpressions?: (boolean | {
|
|
7001
|
+
CallExpression?: boolean
|
|
7002
|
+
AwaitExpression?: boolean
|
|
7003
|
+
NewExpression?: boolean
|
|
7004
|
+
})
|
|
6893
7005
|
offsetTernaryExpressionsOffsetCallExpressions?: boolean
|
|
6894
7006
|
ignoredNodes?: string[]
|
|
6895
7007
|
ignoreComments?: boolean
|
|
@@ -7692,6 +7804,7 @@ type StylisticObjectCurlySpacing = []|[("always" | "never")]|[("always" | "never
|
|
|
7692
7804
|
TSInterfaceBody?: ("always" | "never")
|
|
7693
7805
|
TSEnumBody?: ("always" | "never")
|
|
7694
7806
|
}
|
|
7807
|
+
emptyObjects?: ("ignore" | "always" | "never")
|
|
7695
7808
|
}]
|
|
7696
7809
|
// ----- @stylistic/object-property-newline -----
|
|
7697
7810
|
type StylisticObjectPropertyNewline = []|[{
|
|
@@ -11379,6 +11492,11 @@ type NodeDependenciesNoRestrictedDeps = (string | {
|
|
|
11379
11492
|
message?: string
|
|
11380
11493
|
deep?: ("local" | "server")
|
|
11381
11494
|
})[]
|
|
11495
|
+
// ----- node-dependencies/require-provenance-deps -----
|
|
11496
|
+
type NodeDependenciesRequireProvenanceDeps = []|[{
|
|
11497
|
+
devDependencies?: boolean
|
|
11498
|
+
allows?: string[]
|
|
11499
|
+
}]
|
|
11382
11500
|
// ----- node-dependencies/valid-engines -----
|
|
11383
11501
|
type NodeDependenciesValidEngines = []|[{
|
|
11384
11502
|
deep?: boolean
|
|
@@ -14678,6 +14796,8 @@ type PnpmJsonValidCatalog = []|[{
|
|
|
14678
14796
|
// ----- pnpm/yaml-no-duplicate-catalog-item -----
|
|
14679
14797
|
type PnpmYamlNoDuplicateCatalogItem = []|[{
|
|
14680
14798
|
allow?: string[]
|
|
14799
|
+
|
|
14800
|
+
checkDuplicates?: ("name-only" | "exact-version")
|
|
14681
14801
|
}]
|
|
14682
14802
|
// ----- prefer-arrow-callback -----
|
|
14683
14803
|
type PreferArrowCallback = []|[{
|
|
@@ -14763,10 +14883,124 @@ type ReactDomNoUnknownProperty = []|[{
|
|
|
14763
14883
|
ignore?: string[]
|
|
14764
14884
|
requireDataLowercase?: boolean
|
|
14765
14885
|
}]
|
|
14886
|
+
// ----- react-hooks/automatic-effect-dependencies -----
|
|
14887
|
+
type ReactHooksAutomaticEffectDependencies = []|[{
|
|
14888
|
+
[k: string]: unknown | undefined
|
|
14889
|
+
}]
|
|
14890
|
+
// ----- react-hooks/capitalized-calls -----
|
|
14891
|
+
type ReactHooksCapitalizedCalls = []|[{
|
|
14892
|
+
[k: string]: unknown | undefined
|
|
14893
|
+
}]
|
|
14894
|
+
// ----- react-hooks/component-hook-factories -----
|
|
14895
|
+
type ReactHooksComponentHookFactories = []|[{
|
|
14896
|
+
[k: string]: unknown | undefined
|
|
14897
|
+
}]
|
|
14898
|
+
// ----- react-hooks/config -----
|
|
14899
|
+
type ReactHooksConfig = []|[{
|
|
14900
|
+
[k: string]: unknown | undefined
|
|
14901
|
+
}]
|
|
14902
|
+
// ----- react-hooks/error-boundaries -----
|
|
14903
|
+
type ReactHooksErrorBoundaries = []|[{
|
|
14904
|
+
[k: string]: unknown | undefined
|
|
14905
|
+
}]
|
|
14766
14906
|
// ----- react-hooks/exhaustive-deps -----
|
|
14767
14907
|
type ReactHooksExhaustiveDeps = []|[{
|
|
14768
14908
|
additionalHooks?: string
|
|
14769
14909
|
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean
|
|
14910
|
+
experimental_autoDependenciesHooks?: string[]
|
|
14911
|
+
requireExplicitEffectDeps?: boolean
|
|
14912
|
+
}]
|
|
14913
|
+
// ----- react-hooks/fbt -----
|
|
14914
|
+
type ReactHooksFbt = []|[{
|
|
14915
|
+
[k: string]: unknown | undefined
|
|
14916
|
+
}]
|
|
14917
|
+
// ----- react-hooks/fire -----
|
|
14918
|
+
type ReactHooksFire = []|[{
|
|
14919
|
+
[k: string]: unknown | undefined
|
|
14920
|
+
}]
|
|
14921
|
+
// ----- react-hooks/gating -----
|
|
14922
|
+
type ReactHooksGating = []|[{
|
|
14923
|
+
[k: string]: unknown | undefined
|
|
14924
|
+
}]
|
|
14925
|
+
// ----- react-hooks/globals -----
|
|
14926
|
+
type ReactHooksGlobals = []|[{
|
|
14927
|
+
[k: string]: unknown | undefined
|
|
14928
|
+
}]
|
|
14929
|
+
// ----- react-hooks/hooks -----
|
|
14930
|
+
type ReactHooksHooks = []|[{
|
|
14931
|
+
[k: string]: unknown | undefined
|
|
14932
|
+
}]
|
|
14933
|
+
// ----- react-hooks/immutability -----
|
|
14934
|
+
type ReactHooksImmutability = []|[{
|
|
14935
|
+
[k: string]: unknown | undefined
|
|
14936
|
+
}]
|
|
14937
|
+
// ----- react-hooks/incompatible-library -----
|
|
14938
|
+
type ReactHooksIncompatibleLibrary = []|[{
|
|
14939
|
+
[k: string]: unknown | undefined
|
|
14940
|
+
}]
|
|
14941
|
+
// ----- react-hooks/invariant -----
|
|
14942
|
+
type ReactHooksInvariant = []|[{
|
|
14943
|
+
[k: string]: unknown | undefined
|
|
14944
|
+
}]
|
|
14945
|
+
// ----- react-hooks/memoized-effect-dependencies -----
|
|
14946
|
+
type ReactHooksMemoizedEffectDependencies = []|[{
|
|
14947
|
+
[k: string]: unknown | undefined
|
|
14948
|
+
}]
|
|
14949
|
+
// ----- react-hooks/no-deriving-state-in-effects -----
|
|
14950
|
+
type ReactHooksNoDerivingStateInEffects = []|[{
|
|
14951
|
+
[k: string]: unknown | undefined
|
|
14952
|
+
}]
|
|
14953
|
+
// ----- react-hooks/preserve-manual-memoization -----
|
|
14954
|
+
type ReactHooksPreserveManualMemoization = []|[{
|
|
14955
|
+
[k: string]: unknown | undefined
|
|
14956
|
+
}]
|
|
14957
|
+
// ----- react-hooks/purity -----
|
|
14958
|
+
type ReactHooksPurity = []|[{
|
|
14959
|
+
[k: string]: unknown | undefined
|
|
14960
|
+
}]
|
|
14961
|
+
// ----- react-hooks/refs -----
|
|
14962
|
+
type ReactHooksRefs = []|[{
|
|
14963
|
+
[k: string]: unknown | undefined
|
|
14964
|
+
}]
|
|
14965
|
+
// ----- react-hooks/rule-suppression -----
|
|
14966
|
+
type ReactHooksRuleSuppression = []|[{
|
|
14967
|
+
[k: string]: unknown | undefined
|
|
14968
|
+
}]
|
|
14969
|
+
// ----- react-hooks/rules-of-hooks -----
|
|
14970
|
+
type ReactHooksRulesOfHooks = []|[{
|
|
14971
|
+
additionalHooks?: string
|
|
14972
|
+
}]
|
|
14973
|
+
// ----- react-hooks/set-state-in-effect -----
|
|
14974
|
+
type ReactHooksSetStateInEffect = []|[{
|
|
14975
|
+
[k: string]: unknown | undefined
|
|
14976
|
+
}]
|
|
14977
|
+
// ----- react-hooks/set-state-in-render -----
|
|
14978
|
+
type ReactHooksSetStateInRender = []|[{
|
|
14979
|
+
[k: string]: unknown | undefined
|
|
14980
|
+
}]
|
|
14981
|
+
// ----- react-hooks/static-components -----
|
|
14982
|
+
type ReactHooksStaticComponents = []|[{
|
|
14983
|
+
[k: string]: unknown | undefined
|
|
14984
|
+
}]
|
|
14985
|
+
// ----- react-hooks/syntax -----
|
|
14986
|
+
type ReactHooksSyntax = []|[{
|
|
14987
|
+
[k: string]: unknown | undefined
|
|
14988
|
+
}]
|
|
14989
|
+
// ----- react-hooks/todo -----
|
|
14990
|
+
type ReactHooksTodo = []|[{
|
|
14991
|
+
[k: string]: unknown | undefined
|
|
14992
|
+
}]
|
|
14993
|
+
// ----- react-hooks/unsupported-syntax -----
|
|
14994
|
+
type ReactHooksUnsupportedSyntax = []|[{
|
|
14995
|
+
[k: string]: unknown | undefined
|
|
14996
|
+
}]
|
|
14997
|
+
// ----- react-hooks/use-memo -----
|
|
14998
|
+
type ReactHooksUseMemo = []|[{
|
|
14999
|
+
[k: string]: unknown | undefined
|
|
15000
|
+
}]
|
|
15001
|
+
// ----- react-hooks/void-use-memo -----
|
|
15002
|
+
type ReactHooksVoidUseMemo = []|[{
|
|
15003
|
+
[k: string]: unknown | undefined
|
|
14770
15004
|
}]
|
|
14771
15005
|
// ----- react-naming-convention/component-name -----
|
|
14772
15006
|
type ReactNamingConventionComponentName = []|[(("PascalCase" | "CONSTANT_CASE") | {
|
|
@@ -14793,6 +15027,21 @@ type ReactRefreshOnlyExportComponents = []|[{
|
|
|
14793
15027
|
customHOCs?: string[]
|
|
14794
15028
|
checkJS?: boolean
|
|
14795
15029
|
}]
|
|
15030
|
+
// ----- react/jsx-shorthand-boolean -----
|
|
15031
|
+
type ReactJsxShorthandBoolean = []|[(-1 | 1)]
|
|
15032
|
+
// ----- react/jsx-shorthand-fragment -----
|
|
15033
|
+
type ReactJsxShorthandFragment = []|[(-1 | 1)]
|
|
15034
|
+
// ----- react/no-forbidden-props -----
|
|
15035
|
+
type ReactNoForbiddenProps = []|[{
|
|
15036
|
+
forbid?: (string | {
|
|
15037
|
+
excludedNodes?: string[]
|
|
15038
|
+
prop: string
|
|
15039
|
+
} | {
|
|
15040
|
+
includedNodes?: string[]
|
|
15041
|
+
prop: string
|
|
15042
|
+
})[]
|
|
15043
|
+
[k: string]: unknown | undefined
|
|
15044
|
+
}]
|
|
14796
15045
|
// ----- react/no-useless-fragment -----
|
|
14797
15046
|
type ReactNoUselessFragment = []|[{
|
|
14798
15047
|
|
|
@@ -15754,7 +16003,7 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
|
|
|
15754
16003
|
*
|
|
15755
16004
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects
|
|
15756
16005
|
*/
|
|
15757
|
-
type Config<R extends
|
|
16006
|
+
type Config<R extends RulesConfig = Rules> = Linter.Config<R>
|
|
15758
16007
|
|
|
15759
16008
|
/**
|
|
15760
16009
|
* Defines the names of the available ESLint configurations.
|