@jimmy.codes/eslint-config 8.0.1 → 9.0.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.mts CHANGED
@@ -4911,11 +4911,6 @@ interface RuleOptions {
4911
4911
  * @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
4912
4912
  */
4913
4913
  'react-dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>;
4914
- /**
4915
- * Enforces the absence of a 'namespace' in React elements.
4916
- * @see https://eslint-react.xyz/docs/rules/dom-no-namespace
4917
- */
4918
- 'react-dom/no-namespace'?: Linter.RuleEntry<[]>;
4919
4914
  /**
4920
4915
  * Replaces usage of 'ReactDOM.render()' with 'createRoot(node).render()'.
4921
4916
  * @see https://eslint-react.xyz/docs/rules/dom-no-render
@@ -4961,16 +4956,6 @@ interface RuleOptions {
4961
4956
  * @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
4962
4957
  */
4963
4958
  'react-dom/no-void-elements-with-children'?: Linter.RuleEntry<[]>;
4964
- /**
4965
- * Enforces importing React DOM via a namespace import.
4966
- * @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
4967
- */
4968
- 'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>;
4969
- /**
4970
- * Disallows direct calls to the ['set' function](https://react.dev/reference/react/useState#setstate) of 'useState' in 'useEffect'.
4971
- * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
4972
- */
4973
- 'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>;
4974
4959
  /**
4975
4960
  * Validates against calling capitalized functions/methods instead of using JSX
4976
4961
  * @see https://react.dev/reference/eslint-plugin-react-hooks/lints/capitalized-calls
@@ -5117,25 +5102,10 @@ interface RuleOptions {
5117
5102
  */
5118
5103
  'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>;
5119
5104
  /**
5120
- * Enforces naming conventions for components.
5121
- * @see https://eslint-react.xyz/docs/rules/naming-convention-component-name
5122
- */
5123
- 'react-naming-convention/component-name'?: Linter.RuleEntry<ReactNamingConventionComponentName>;
5124
- /**
5125
- * Enforces the context name to be a valid component name with the suffix 'Context'.
5105
+ * Enforces identifier names assigned from `createContext` calls to be a valid component name with the suffix `Context`.
5126
5106
  * @see https://eslint-react.xyz/docs/rules/naming-convention-context-name
5127
5107
  */
5128
5108
  'react-naming-convention/context-name'?: Linter.RuleEntry<[]>;
5129
- /**
5130
- * Enforces consistent file-naming conventions.
5131
- * @see https://eslint-react.xyz/docs/rules/naming-convention-filename
5132
- */
5133
- 'react-naming-convention/filename'?: Linter.RuleEntry<ReactNamingConventionFilename>;
5134
- /**
5135
- * Enforces consistent use of the JSX file extension.
5136
- * @see https://eslint-react.xyz/docs/rules/naming-convention-filename-extension
5137
- */
5138
- 'react-naming-convention/filename-extension'?: Linter.RuleEntry<ReactNamingConventionFilenameExtension>;
5139
5109
  /**
5140
5110
  * Enforces identifier names assigned from 'useId' calls to be either 'id' or end with 'Id'.
5141
5111
  * @see https://eslint-react.xyz/docs/rules/naming-convention-id-name
@@ -5146,15 +5116,10 @@ interface RuleOptions {
5146
5116
  * @see https://eslint-react.xyz/docs/rules/naming-convention-ref-name
5147
5117
  */
5148
5118
  'react-naming-convention/ref-name'?: Linter.RuleEntry<[]>;
5149
- /**
5150
- * Enforces destructuring and symmetric naming of the 'useState' hook value and setter.
5151
- * @see https://eslint-react.xyz/docs/rules/naming-convention-use-state
5152
- */
5153
- 'react-naming-convention/use-state'?: Linter.RuleEntry<ReactNamingConventionUseState>;
5154
5119
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
5155
5120
  /**
5156
- * Validate and transform React Client/Server Function definitions.
5157
- * @see https://eslint-react.xyz/docs/rules/function-definition
5121
+ * Validates and transforms React Client/Server Function definitions.
5122
+ * @see https://eslint-react.xyz/docs/rules/rsc-function-definition
5158
5123
  */
5159
5124
  'react-rsc/function-definition'?: Linter.RuleEntry<[]>;
5160
5125
  /**
@@ -5162,6 +5127,11 @@ interface RuleOptions {
5162
5127
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
5163
5128
  */
5164
5129
  'react-web-api/no-leaked-event-listener'?: Linter.RuleEntry<[]>;
5130
+ /**
5131
+ * Enforces that every 'fetch' in a component or custom hook has a corresponding 'AbortController' abort in the cleanup function.
5132
+ * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-fetch
5133
+ */
5134
+ 'react-web-api/no-leaked-fetch'?: Linter.RuleEntry<[]>;
5165
5135
  /**
5166
5136
  * Enforces that every 'setInterval' in a component or custom hook has a corresponding 'clearInterval'.
5167
5137
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
@@ -5178,55 +5148,25 @@ interface RuleOptions {
5178
5148
  */
5179
5149
  'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>;
5180
5150
  /**
5181
- * Prevents unintentional '$' sign before expression.
5182
- * @see https://eslint-react.xyz/docs/rules/jsx-dollar
5183
- */
5184
- 'react-x/jsx-dollar'?: Linter.RuleEntry<[]>;
5185
- /**
5186
- * Enforces 'key' prop placement before spread props.
5187
- * @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread
5151
+ * Validates usage of Error Boundaries instead of try/catch for errors in child components.
5152
+ * @see https://eslint-react.xyz/docs/rules/error-boundaries
5188
5153
  */
5189
- 'react-x/jsx-key-before-spread'?: Linter.RuleEntry<[]>;
5154
+ 'react-x/error-boundaries'?: Linter.RuleEntry<[]>;
5190
5155
  /**
5191
- * Prevents comment strings (e.g., beginning with '//' or '/*') from being accidentally inserted into a JSX element's text nodes.
5192
- * @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
5193
- */
5194
- 'react-x/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
5195
- /**
5196
- * Disallows duplicate props in JSX elements.
5197
- * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
5198
- */
5199
- 'react-x/jsx-no-duplicate-props'?: Linter.RuleEntry<[]>;
5200
- /**
5201
- * Disallows immediately-invoked function expressions in JSX.
5202
- * @see https://eslint-react.xyz/docs/rules/jsx-no-iife
5203
- */
5204
- 'react-x/jsx-no-iife'?: Linter.RuleEntry<[]>;
5205
- /**
5206
- * Prevents using variables in JSX that are not defined in the scope.
5207
- * @see https://eslint-react.xyz/docs/rules/jsx-no-undef
5208
- */
5209
- 'react-x/jsx-no-undef'?: Linter.RuleEntry<[]>;
5210
- /**
5211
- * Enforces shorthand syntax for boolean props.
5212
- * @see https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean
5213
- */
5214
- 'react-x/jsx-shorthand-boolean'?: Linter.RuleEntry<ReactXJsxShorthandBoolean>;
5215
- /**
5216
- * Enforces shorthand syntax for fragment elements.
5217
- * @see https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment
5156
+ * Verifies the list of dependencies for Hooks like 'useEffect' and similar.
5157
+ * @see https://github.com/facebook/react/issues/14920
5218
5158
  */
5219
- 'react-x/jsx-shorthand-fragment'?: Linter.RuleEntry<ReactXJsxShorthandFragment>;
5159
+ 'react-x/exhaustive-deps'?: Linter.RuleEntry<ReactXExhaustiveDeps>;
5220
5160
  /**
5221
- * Marks React variables as used when JSX is present.
5222
- * @see https://eslint-react.xyz/docs/rules/jsx-uses-react
5161
+ * Validates against assignment/mutation of globals during render, part of ensuring that side effects must run outside of render.
5162
+ * @see https://eslint-react.xyz/docs/rules/globals
5223
5163
  */
5224
- 'react-x/jsx-uses-react'?: Linter.RuleEntry<[]>;
5164
+ 'react-x/globals'?: Linter.RuleEntry<[]>;
5225
5165
  /**
5226
- * Marks JSX element variables as used.
5227
- * @see https://eslint-react.xyz/docs/rules/jsx-uses-vars
5166
+ * Validates against mutating props, state, and other values that are immutable.
5167
+ * @see https://eslint-react.xyz/docs/rules/immutability
5228
5168
  */
5229
- 'react-x/jsx-uses-vars'?: Linter.RuleEntry<[]>;
5169
+ 'react-x/immutability'?: Linter.RuleEntry<[]>;
5230
5170
  /**
5231
5171
  * Disallows accessing 'this.state' inside 'setState' calls.
5232
5172
  * @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate
@@ -5257,11 +5197,6 @@ interface RuleOptions {
5257
5197
  * @see https://eslint-react.xyz/docs/rules/no-children-only
5258
5198
  */
5259
5199
  'react-x/no-children-only'?: Linter.RuleEntry<[]>;
5260
- /**
5261
- * Disallows passing 'children' as a prop.
5262
- * @see https://eslint-react.xyz/docs/rules/no-children-prop
5263
- */
5264
- 'react-x/no-children-prop'?: Linter.RuleEntry<[]>;
5265
5200
  /**
5266
5201
  * Disallows the use of 'Children.toArray' from the 'react' package.
5267
5202
  * @see https://eslint-react.xyz/docs/rules/no-children-to-array
@@ -5298,15 +5233,10 @@ interface RuleOptions {
5298
5233
  */
5299
5234
  'react-x/no-context-provider'?: Linter.RuleEntry<[]>;
5300
5235
  /**
5301
- * Disallows 'createRef' in function components.
5236
+ * Disallows 'createRef' in function components and Hooks.
5302
5237
  * @see https://eslint-react.xyz/docs/rules/no-create-ref
5303
5238
  */
5304
5239
  'react-x/no-create-ref'?: Linter.RuleEntry<[]>;
5305
- /**
5306
- * Disallows the 'defaultProps' property in favor of ES6 default parameters.
5307
- * @see https://eslint-react.xyz/docs/rules/no-default-props
5308
- */
5309
- 'react-x/no-default-props'?: Linter.RuleEntry<[]>;
5310
5240
  /**
5311
5241
  * Disallows direct mutation of 'this.state'.
5312
5242
  * @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
@@ -5317,22 +5247,26 @@ interface RuleOptions {
5317
5247
  * @see https://eslint-react.xyz/docs/rules/no-duplicate-key
5318
5248
  */
5319
5249
  'react-x/no-duplicate-key'?: Linter.RuleEntry<[]>;
5320
- /**
5321
- * Disallows certain props on components.
5322
- * @see https://eslint-react.xyz/docs/rules/no-forbidden-props
5323
- * @deprecated
5324
- */
5325
- 'react-x/no-forbidden-props'?: Linter.RuleEntry<ReactXNoForbiddenProps>;
5326
5250
  /**
5327
5251
  * Replaces usage of 'forwardRef' with passing 'ref' as a prop.
5328
5252
  * @see https://eslint-react.xyz/docs/rules/no-forward-ref
5329
5253
  */
5330
5254
  'react-x/no-forward-ref'?: Linter.RuleEntry<[]>;
5255
+ /**
5256
+ * Prevents implicitly passing the 'children' prop to components.
5257
+ * @see https://eslint-react.xyz/docs/rules/no-implicit-children
5258
+ */
5259
+ 'react-x/no-implicit-children'?: Linter.RuleEntry<[]>;
5331
5260
  /**
5332
5261
  * Prevents implicitly passing the 'key' prop to components.
5333
5262
  * @see https://eslint-react.xyz/docs/rules/no-implicit-key
5334
5263
  */
5335
5264
  'react-x/no-implicit-key'?: Linter.RuleEntry<[]>;
5265
+ /**
5266
+ * Prevents implicitly passing the 'ref' prop to components.
5267
+ * @see https://eslint-react.xyz/docs/rules/no-implicit-ref
5268
+ */
5269
+ 'react-x/no-implicit-ref'?: Linter.RuleEntry<[]>;
5336
5270
  /**
5337
5271
  * Prevents problematic leaked values from being rendered.
5338
5272
  * @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
@@ -5364,20 +5298,10 @@ interface RuleOptions {
5364
5298
  */
5365
5299
  'react-x/no-nested-component-definitions'?: Linter.RuleEntry<[]>;
5366
5300
  /**
5367
- * Disallows nesting lazy component declarations inside other components.
5301
+ * Disallows nesting lazy component declarations inside other components or hooks.
5368
5302
  * @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
5369
5303
  */
5370
5304
  'react-x/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
5371
- /**
5372
- * Disallows 'propTypes' in favor of TypeScript or another type-checking solution.
5373
- * @see https://eslint-react.xyz/docs/rules/no-prop-types
5374
- */
5375
- 'react-x/no-prop-types'?: Linter.RuleEntry<[]>;
5376
- /**
5377
- * Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'.
5378
- * @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
5379
- */
5380
- 'react-x/no-redundant-should-component-update'?: Linter.RuleEntry<[]>;
5381
5305
  /**
5382
5306
  * Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
5383
5307
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
@@ -5393,36 +5317,11 @@ interface RuleOptions {
5393
5317
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
5394
5318
  */
5395
5319
  'react-x/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
5396
- /**
5397
- * Replaces string refs with callback refs.
5398
- * @see https://eslint-react.xyz/docs/rules/no-string-refs
5399
- */
5400
- 'react-x/no-string-refs'?: Linter.RuleEntry<[]>;
5401
- /**
5402
- * Disallows unnecessary 'key' props on nested child elements when rendering lists.
5403
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
5404
- */
5405
- 'react-x/no-unnecessary-key'?: Linter.RuleEntry<[]>;
5406
- /**
5407
- * Disallows unnecessary usage of 'useCallback'.
5408
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
5409
- */
5410
- 'react-x/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
5411
- /**
5412
- * Disallows unnecessary usage of 'useMemo'.
5413
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
5414
- */
5415
- 'react-x/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
5416
5320
  /**
5417
5321
  * Enforces that a function with the 'use' prefix uses at least one Hook inside it.
5418
5322
  * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
5419
5323
  */
5420
5324
  'react-x/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
5421
- /**
5422
- * Disallows unnecessary usage of 'useRef'.
5423
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-ref
5424
- */
5425
- 'react-x/no-unnecessary-use-ref'?: Linter.RuleEntry<[]>;
5426
5325
  /**
5427
5326
  * Warns about the use of 'UNSAFE_componentWillMount' in class components.
5428
5327
  * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
@@ -5459,7 +5358,7 @@ interface RuleOptions {
5459
5358
  */
5460
5359
  'react-x/no-unused-props'?: Linter.RuleEntry<[]>;
5461
5360
  /**
5462
- * Warns about unused class component state.
5361
+ * Warns about state variables that are defined but never used.
5463
5362
  * @see https://eslint-react.xyz/docs/rules/no-unused-state
5464
5363
  */
5465
5364
  'react-x/no-unused-state'?: Linter.RuleEntry<[]>;
@@ -5469,35 +5368,50 @@ interface RuleOptions {
5469
5368
  */
5470
5369
  'react-x/no-use-context'?: Linter.RuleEntry<[]>;
5471
5370
  /**
5472
- * Disallows useless 'forwardRef' calls on components that don't use 'ref's.
5473
- * @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref
5371
+ * Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
5372
+ * @see https://eslint-react.xyz/docs/rules/purity
5474
5373
  */
5475
- 'react-x/no-useless-forward-ref'?: Linter.RuleEntry<[]>;
5374
+ 'react-x/purity'?: Linter.RuleEntry<[]>;
5476
5375
  /**
5477
- * Disallows useless fragment elements.
5478
- * @see https://eslint-react.xyz/docs/rules/no-useless-fragment
5376
+ * Validates correct usage of refs by checking that 'ref.current' is not read or written during render.
5377
+ * @see https://eslint-react.xyz/docs/rules/refs
5479
5378
  */
5480
- 'react-x/no-useless-fragment'?: Linter.RuleEntry<ReactXNoUselessFragment>;
5379
+ 'react-x/refs'?: Linter.RuleEntry<[]>;
5481
5380
  /**
5482
- * Enforces destructuring assignment for component props and context.
5483
- * @see https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment
5381
+ * Enforces the Rules of Hooks.
5382
+ * @see https://react.dev/reference/rules/rules-of-hooks
5484
5383
  */
5485
- 'react-x/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>;
5384
+ 'react-x/rules-of-hooks'?: Linter.RuleEntry<ReactXRulesOfHooks>;
5486
5385
  /**
5487
- * Enforces importing React via a namespace import.
5488
- * @see https://eslint-react.xyz/docs/rules/prefer-namespace-import
5386
+ * Validates against setting state synchronously in an effect, which can lead to re-renders that degrade performance.
5387
+ * @see https://eslint-react.xyz/docs/rules/set-state-in-effect
5489
5388
  */
5490
- 'react-x/prefer-namespace-import'?: Linter.RuleEntry<[]>;
5389
+ 'react-x/set-state-in-effect'?: Linter.RuleEntry<[]>;
5491
5390
  /**
5492
- * Enforces read-only props in components.
5493
- * @see https://eslint-react.xyz/docs/rules/prefer-read-only-props
5391
+ * Validates against unconditionally setting state during render, which can trigger additional renders and potential infinite render loops.
5392
+ * @see https://eslint-react.xyz/docs/rules/set-state-in-render
5494
5393
  */
5495
- 'react-x/prefer-read-only-props'?: Linter.RuleEntry<[]>;
5394
+ 'react-x/set-state-in-render'?: Linter.RuleEntry<[]>;
5496
5395
  /**
5497
- * Enforces wrapping function calls made inside 'useState' in an 'initializer function'.
5498
- * @see https://eslint-react.xyz/docs/rules/prefer-use-state-lazy-initialization
5396
+ * Validates that components are static, not recreated every render.
5397
+ * @see https://eslint-react.xyz/docs/rules/static-components
5499
5398
  */
5500
- 'react-x/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>;
5399
+ 'react-x/static-components'?: Linter.RuleEntry<[]>;
5400
+ /**
5401
+ * Validates against syntax that React Compiler does not support.
5402
+ * @see https://eslint-react.xyz/docs/rules/unsupported-syntax
5403
+ */
5404
+ 'react-x/unsupported-syntax'?: Linter.RuleEntry<[]>;
5405
+ /**
5406
+ * Validates that 'useMemo' is called with a callback that returns a value.
5407
+ * @see https://eslint-react.xyz/docs/rules/use-memo
5408
+ */
5409
+ 'react-x/use-memo'?: Linter.RuleEntry<[]>;
5410
+ /**
5411
+ * Enforces correct usage of 'useState', including destructuring, symmetric naming of the value and setter, and wrapping expensive initializers in a lazy initializer function.
5412
+ * @see https://eslint-react.xyz/docs/rules/use-state
5413
+ */
5414
+ 'react-x/use-state'?: Linter.RuleEntry<ReactXUseState>;
5501
5415
  /**
5502
5416
  * disallow confusing quantifiers
5503
5417
  * @see https://ota-meshi.github.io/eslint-plugin-regexp/rules/confusing-quantifier.html
@@ -14810,49 +14724,29 @@ type ReactHooksUseMemo = [] | [{
14810
14724
  }]; // ----- react-hooks/void-use-memo -----
14811
14725
  type ReactHooksVoidUseMemo = [] | [{
14812
14726
  [k: string]: unknown | undefined;
14813
- }]; // ----- react-naming-convention/component-name -----
14814
- type ReactNamingConventionComponentName = [] | [(("PascalCase" | "CONSTANT_CASE") | {
14815
- allowAllCaps?: boolean;
14816
- excepts?: string[];
14817
- rule?: ("PascalCase" | "CONSTANT_CASE");
14818
- })]; // ----- react-naming-convention/filename -----
14819
- type ReactNamingConventionFilename = [] | [(("PascalCase" | "camelCase" | "kebab-case" | "snake_case") | {
14820
- excepts?: string[];
14821
- extensions?: string[];
14822
- rule?: ("PascalCase" | "camelCase" | "kebab-case" | "snake_case");
14823
- })]; // ----- react-naming-convention/filename-extension -----
14824
- type ReactNamingConventionFilenameExtension = [] | [(("always" | "as-needed") | {
14825
- allow?: ("always" | "as-needed");
14826
- extensions?: string[];
14827
- ignoreFilesWithoutCode?: boolean;
14828
- })]; // ----- react-naming-convention/use-state -----
14829
- type ReactNamingConventionUseState = [] | [{
14830
- enforceAssignment?: boolean;
14831
- enforceSetterName?: boolean;
14832
14727
  }]; // ----- react-refresh/only-export-components -----
14833
14728
  type ReactRefreshOnlyExportComponents = [] | [{
14834
14729
  extraHOCs?: string[];
14835
14730
  allowExportNames?: string[];
14836
14731
  allowConstantExport?: boolean;
14837
14732
  checkJS?: boolean;
14838
- }]; // ----- react-x/jsx-shorthand-boolean -----
14839
- type ReactXJsxShorthandBoolean = [] | [(-1 | 1)]; // ----- react-x/jsx-shorthand-fragment -----
14840
- type ReactXJsxShorthandFragment = [] | [(-1 | 1)]; // ----- react-x/no-forbidden-props -----
14841
- type ReactXNoForbiddenProps = [] | [{
14842
- forbid?: (string | {
14843
- excludedNodes?: string[];
14844
- prop: string;
14845
- } | {
14846
- includedNodes?: string[];
14847
- prop: string;
14848
- })[];
14733
+ }]; // ----- react-x/exhaustive-deps -----
14734
+ type ReactXExhaustiveDeps = [] | [{
14735
+ additionalHooks?: string;
14736
+ enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean;
14737
+ experimental_autoDependenciesHooks?: string[];
14738
+ requireExplicitEffectDeps?: boolean;
14849
14739
  }]; // ----- react-x/no-unstable-default-props -----
14850
14740
  type ReactXNoUnstableDefaultProps = [] | [{
14851
14741
  safeDefaultProps?: string[];
14852
- }]; // ----- react-x/no-useless-fragment -----
14853
- type ReactXNoUselessFragment = [] | [{
14854
- allowEmptyFragment?: boolean;
14855
- allowExpressions?: boolean;
14742
+ }]; // ----- react-x/rules-of-hooks -----
14743
+ type ReactXRulesOfHooks = [] | [{
14744
+ additionalHooks?: string;
14745
+ }]; // ----- react-x/use-state -----
14746
+ type ReactXUseState = [] | [{
14747
+ enforceAssignment?: boolean;
14748
+ enforceLazyInitialization?: boolean;
14749
+ enforceSetterName?: boolean;
14856
14750
  }]; // ----- regexp/hexadecimal-escape -----
14857
14751
  type RegexpHexadecimalEscape = [] | [("always" | "never")]; // ----- regexp/letter-case -----
14858
14752
  type RegexpLetterCase = [] | [{
@@ -15468,7 +15362,7 @@ interface ReactOptions {
15468
15362
  /**
15469
15363
  * Additional rules to override React defaults.
15470
15364
  */
15471
- overrides?: RulesWithPrefix<RuleOptions, "jsx-a11y" | "react-compiler" | "react-dom" | "react-hooks" | "react-hooks-extra" | "react-naming-convention" | "react-refresh" | "react-web-api" | "react-x">;
15365
+ overrides?: RulesWithPrefix<RuleOptions, "jsx-a11y" | "react-compiler" | "react-dom" | "react-hooks" | "react-naming-convention" | "react-refresh" | "react-web-api" | "react-x">;
15472
15366
  }
15473
15367
  interface StorybookOptions {
15474
15368
  /**
package/dist/index.mjs CHANGED
@@ -544,7 +544,7 @@ const defineConfig = async ({ astro = false, autoDetect = true, gitignore = fals
544
544
  ];
545
545
  const featureConfigs = await Promise.all([
546
546
  isTypescriptEnabled && unwrap(import("./typescript-Bes71C1G.mjs"), typescript),
547
- isReactEnabled && unwrap(import("./react-1yNNvfAV.mjs"), react),
547
+ isReactEnabled && unwrap(import("./react-B7au0vDW.mjs"), react),
548
548
  isTanstackQueryEnabled && unwrap(import("./tanstack-query-DDneXpNy.mjs"), tanstackQuery),
549
549
  isAstroEnabled && unwrap(import("./astro-aQAlBamd.mjs"), astro),
550
550
  isJestEnabled && unwrap(import("./jest-nmog_kTA.mjs"), jest),
@@ -26,11 +26,10 @@ const nextAllowedExportNames = [
26
26
  "contentType"
27
27
  ];
28
28
  const reactRules = async (options) => {
29
- const [{ configs: reactConfigs }, { configs: jsxA11yConfigs }, { configs: reactDomConfigs }, { configs: reactHooksExtraConfigs }, { configs: reactWebApiConfigs }, { configs: reactNamingConventionConfigs }, { configs: reactRscConfigs }] = await Promise.all([
29
+ const [{ configs: reactConfigs }, { configs: jsxA11yConfigs }, { configs: reactDomConfigs }, { configs: reactWebApiConfigs }, { configs: reactNamingConventionConfigs }, { configs: reactRscConfigs }] = await Promise.all([
30
30
  unwrapDefault(import("eslint-plugin-react-x")),
31
31
  unwrapDefault(import("eslint-plugin-jsx-a11y-x")),
32
32
  unwrapDefault(import("eslint-plugin-react-dom")),
33
- unwrapDefault(import("eslint-plugin-react-hooks-extra")),
34
33
  unwrapDefault(import("eslint-plugin-react-web-api")),
35
34
  unwrapDefault(import("eslint-plugin-react-naming-convention")),
36
35
  unwrapDefault(import("eslint-plugin-react-rsc"))
@@ -52,12 +51,10 @@ const reactRules = async (options) => {
52
51
  ...rebrand(jsxA11yConfigs.recommended.rules, "jsx-a11y-x", "jsx-a11y"),
53
52
  ...upwarn(reactPluginRules),
54
53
  ...upwarn(reactDomPluginRules),
55
- ...upwarn(reactHooksExtraConfigs.recommended.rules),
56
54
  ...upwarn(reactWebApiConfigs.recommended.rules),
57
55
  ...upwarn(reactNamingConventionConfigs.recommended.rules),
58
56
  ...upwarn(reactRscConfigs.recommended.rules),
59
57
  "react-compiler/react-compiler": "error",
60
- "react-hooks-extra/no-direct-set-state-in-use-effect": "off",
61
58
  "react-hooks/component-hook-factories": "error",
62
59
  "react-hooks/error-boundaries": "error",
63
60
  "react-hooks/exhaustive-deps": "error",
@@ -74,19 +71,29 @@ const reactRules = async (options) => {
74
71
  "react-hooks/unsupported-syntax": "error",
75
72
  "react-hooks/use-memo": "error",
76
73
  "react-hooks/void-use-memo": "error",
77
- "react-naming-convention/component-name": "error",
78
74
  "react-refresh/only-export-components": ["warn", {
79
75
  allowConstantExport: isUsingVite,
80
76
  allowExportNames: isUsingNextjs ? nextAllowedExportNames : []
81
77
  }],
82
- "react-x/jsx-dollar": "off",
83
- "react-x/jsx-shorthand-boolean": "error",
84
- "react-x/jsx-shorthand-fragment": "error",
78
+ "react-x/error-boundaries": "off",
79
+ "react-x/exhaustive-deps": "off",
80
+ "react-x/globals": "off",
81
+ "react-x/immutability": "off",
85
82
  "react-x/no-duplicate-key": "error",
83
+ "react-x/no-implicit-children": "error",
84
+ "react-x/no-implicit-key": "error",
85
+ "react-x/no-implicit-ref": "error",
86
+ "react-x/no-missing-component-display-name": "off",
86
87
  "react-x/no-missing-context-display-name": "error",
87
- "react-x/no-unnecessary-key": "error",
88
- "react-x/no-unnecessary-use-ref": "error",
89
- "react-x/prefer-namespace-import": "error",
88
+ "react-x/no-unused-state": "off",
89
+ "react-x/purity": "off",
90
+ "react-x/refs": "off",
91
+ "react-x/rules-of-hooks": "off",
92
+ "react-x/set-state-in-effect": "off",
93
+ "react-x/set-state-in-render": "off",
94
+ "react-x/static-components": "off",
95
+ "react-x/unsupported-syntax": "off",
96
+ "react-x/use-memo": "off",
90
97
  ...options?.overrides
91
98
  };
92
99
  };
@@ -94,13 +101,12 @@ const reactRules = async (options) => {
94
101
  //#region src/configs/react.ts
95
102
  async function reactConfig(options) {
96
103
  const extractedOptions = extractOptions(options);
97
- const [reactPlugin, jsxA11yPlugin, reactHooksPlugin, reactRefreshPlugin, reactCompilerPlugin, reactHooksExtraPlugin, reactDomPlugin, reactWebApiPlugin, reactNamingConventionPlugin, reactRscPlugin] = await Promise.all([
104
+ const [reactPlugin, jsxA11yPlugin, reactHooksPlugin, reactRefreshPlugin, reactCompilerPlugin, reactDomPlugin, reactWebApiPlugin, reactNamingConventionPlugin, reactRscPlugin] = await Promise.all([
98
105
  unwrapDefault(import("eslint-plugin-react-x")),
99
106
  unwrapDefault(import("eslint-plugin-jsx-a11y-x")),
100
107
  unwrapDefault(import("eslint-plugin-react-hooks")),
101
108
  unwrapDefault(import("eslint-plugin-react-refresh")),
102
109
  unwrapDefault(import("eslint-plugin-react-compiler")),
103
- unwrapDefault(import("eslint-plugin-react-hooks-extra")),
104
110
  unwrapDefault(import("eslint-plugin-react-dom")),
105
111
  unwrapDefault(import("eslint-plugin-react-web-api")),
106
112
  unwrapDefault(import("eslint-plugin-react-naming-convention")),
@@ -121,7 +127,6 @@ async function reactConfig(options) {
121
127
  "react-compiler": reactCompilerPlugin,
122
128
  "react-dom": reactDomPlugin,
123
129
  "react-hooks": reactHooksPlugin,
124
- "react-hooks-extra": reactHooksExtraPlugin,
125
130
  "react-naming-convention": reactNamingConventionPlugin,
126
131
  "react-refresh": reactRefreshPlugin,
127
132
  "react-rsc": reactRscPlugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimmy.codes/eslint-config",
3
- "version": "8.0.1",
3
+ "version": "9.0.0",
4
4
  "description": "A simple, modern ESLint config that covers most use cases.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -64,14 +64,13 @@
64
64
  "eslint-plugin-perfectionist": "^5.9.0",
65
65
  "eslint-plugin-playwright": "^2.10.4",
66
66
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
67
- "eslint-plugin-react-dom": "^2.13.0",
67
+ "eslint-plugin-react-dom": "^5.8.12",
68
68
  "eslint-plugin-react-hooks": "^7.1.1",
69
- "eslint-plugin-react-hooks-extra": "^2.13.0",
70
- "eslint-plugin-react-naming-convention": "^2.13.0",
69
+ "eslint-plugin-react-naming-convention": "^5.8.12",
71
70
  "eslint-plugin-react-refresh": "0.5.2",
72
- "eslint-plugin-react-rsc": "^2.13.0",
73
- "eslint-plugin-react-web-api": "^2.13.0",
74
- "eslint-plugin-react-x": "^2.13.0",
71
+ "eslint-plugin-react-rsc": "^5.8.12",
72
+ "eslint-plugin-react-web-api": "^5.8.12",
73
+ "eslint-plugin-react-x": "^5.8.12",
75
74
  "eslint-plugin-regexp": "^3.1.0",
76
75
  "eslint-plugin-storybook": "0.12.0",
77
76
  "eslint-plugin-testing-library": "^7.16.2",