@ncontiero/eslint-config 7.3.0-beta.1 → 7.3.0-beta.2

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
@@ -4208,11 +4208,6 @@ interface RuleOptions {
4208
4208
  */
4209
4209
  'radix'?: Linter.RuleEntry<Radix>;
4210
4210
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
4211
- /**
4212
- * Disallows higher order functions that define components or hooks inside them.
4213
- * @see https://eslint-react.xyz/docs/rules/component-hook-factories
4214
- */
4215
- 'react/component-hook-factories'?: Linter.RuleEntry<[]>;
4216
4211
  /**
4217
4212
  * Disallows DOM elements from using 'dangerouslySetInnerHTML'.
4218
4213
  * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
@@ -4293,11 +4288,6 @@ interface RuleOptions {
4293
4288
  * @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
4294
4289
  */
4295
4290
  'react/dom-no-void-elements-with-children'?: Linter.RuleEntry<[]>;
4296
- /**
4297
- * Enforces importing React DOM via a namespace import.
4298
- * @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
4299
- */
4300
- 'react/dom-prefer-namespace-import'?: Linter.RuleEntry<[]>;
4301
4291
  /**
4302
4292
  * Validates usage of Error Boundaries instead of try/catch for errors in child components.
4303
4293
  * @see https://eslint-react.xyz/docs/rules/error-boundaries
@@ -4308,6 +4298,11 @@ interface RuleOptions {
4308
4298
  * @see https://github.com/facebook/react/issues/14920
4309
4299
  */
4310
4300
  'react/exhaustive-deps'?: Linter.RuleEntry<ReactExhaustiveDeps>;
4301
+ /**
4302
+ * Validates against assignment/mutation of globals during render, part of ensuring that side effects must run outside of render.
4303
+ * @see https://eslint-react.xyz/docs/rules/globals
4304
+ */
4305
+ 'react/globals'?: Linter.RuleEntry<[]>;
4311
4306
  /**
4312
4307
  * Validates against mutating props, state, and other values that are immutable.
4313
4308
  * @see https://eslint-react.xyz/docs/rules/immutability
@@ -4503,11 +4498,6 @@ interface RuleOptions {
4503
4498
  * @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
4504
4499
  */
4505
4500
  'react/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
4506
- /**
4507
- * Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'.
4508
- * @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
4509
- */
4510
- 'react/no-redundant-should-component-update'?: Linter.RuleEntry<[]>;
4511
4501
  /**
4512
4502
  * Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
4513
4503
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
@@ -4523,16 +4513,6 @@ interface RuleOptions {
4523
4513
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
4524
4514
  */
4525
4515
  'react/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
4526
- /**
4527
- * Disallows unnecessary usage of 'useCallback'.
4528
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
4529
- */
4530
- 'react/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
4531
- /**
4532
- * Disallows unnecessary usage of 'useMemo'.
4533
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
4534
- */
4535
- 'react/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
4536
4516
  /**
4537
4517
  * Enforces that a function with the 'use' prefix uses at least one Hook inside it.
4538
4518
  * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
@@ -4573,26 +4553,11 @@ interface RuleOptions {
4573
4553
  * @see https://eslint-react.xyz/docs/rules/no-unused-props
4574
4554
  */
4575
4555
  'react/no-unused-props'?: Linter.RuleEntry<[]>;
4576
- /**
4577
- * Warns about unused class component state.
4578
- * @see https://eslint-react.xyz/docs/rules/no-unused-state
4579
- */
4580
- 'react/no-unused-state'?: Linter.RuleEntry<[]>;
4581
4556
  /**
4582
4557
  * Replaces usage of 'useContext' with 'use'.
4583
4558
  * @see https://eslint-react.xyz/docs/rules/no-use-context
4584
4559
  */
4585
4560
  'react/no-use-context'?: Linter.RuleEntry<[]>;
4586
- /**
4587
- * Enforces destructuring assignment for component props and context.
4588
- * @see https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment
4589
- */
4590
- 'react/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>;
4591
- /**
4592
- * Enforces importing React via a namespace import.
4593
- * @see https://eslint-react.xyz/docs/rules/prefer-namespace-import
4594
- */
4595
- 'react/prefer-namespace-import'?: Linter.RuleEntry<[]>;
4596
4561
  /**
4597
4562
  * Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
4598
4563
  * @see https://eslint-react.xyz/docs/rules/purity
@@ -4623,6 +4588,11 @@ interface RuleOptions {
4623
4588
  * @see https://eslint-react.xyz/docs/rules/set-state-in-render
4624
4589
  */
4625
4590
  'react/set-state-in-render'?: Linter.RuleEntry<[]>;
4591
+ /**
4592
+ * Validates that components are static, not recreated every render.
4593
+ * @see https://eslint-react.xyz/docs/rules/static-components
4594
+ */
4595
+ 'react/static-components'?: Linter.RuleEntry<[]>;
4626
4596
  /**
4627
4597
  * Validates against syntax that React Compiler does not support.
4628
4598
  * @see https://eslint-react.xyz/docs/rules/unsupported-syntax
@@ -4643,6 +4613,11 @@ interface RuleOptions {
4643
4613
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
4644
4614
  */
4645
4615
  'react/web-api-no-leaked-event-listener'?: Linter.RuleEntry<[]>;
4616
+ /**
4617
+ * Enforces that every 'fetch' in a component or custom hook has a corresponding 'AbortController' abort in the cleanup function.
4618
+ * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-fetch
4619
+ */
4620
+ 'react/web-api-no-leaked-fetch'?: Linter.RuleEntry<[]>;
4646
4621
  /**
4647
4622
  * Enforces that every 'setInterval' in a component or custom hook has a corresponding 'clearInterval'.
4648
4623
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
@@ -4658,11 +4633,6 @@ interface RuleOptions {
4658
4633
  * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
4659
4634
  */
4660
4635
  'react/web-api-no-leaked-timeout'?: Linter.RuleEntry<[]>;
4661
- /**
4662
- * Disallows higher order functions that define components or hooks inside them.
4663
- * @see https://eslint-react.xyz/docs/rules/component-hook-factories
4664
- */
4665
- 'react/x-component-hook-factories'?: Linter.RuleEntry<[]>;
4666
4636
  /**
4667
4637
  * Validates usage of Error Boundaries instead of try/catch for errors in child components.
4668
4638
  * @see https://eslint-react.xyz/docs/rules/error-boundaries
@@ -4673,6 +4643,11 @@ interface RuleOptions {
4673
4643
  * @see https://github.com/facebook/react/issues/14920
4674
4644
  */
4675
4645
  'react/x-exhaustive-deps'?: Linter.RuleEntry<ReactXExhaustiveDeps>;
4646
+ /**
4647
+ * Validates against assignment/mutation of globals during render, part of ensuring that side effects must run outside of render.
4648
+ * @see https://eslint-react.xyz/docs/rules/globals
4649
+ */
4650
+ 'react/x-globals'?: Linter.RuleEntry<[]>;
4676
4651
  /**
4677
4652
  * Validates against mutating props, state, and other values that are immutable.
4678
4653
  * @see https://eslint-react.xyz/docs/rules/immutability
@@ -4813,11 +4788,6 @@ interface RuleOptions {
4813
4788
  * @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
4814
4789
  */
4815
4790
  'react/x-no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
4816
- /**
4817
- * Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'.
4818
- * @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update
4819
- */
4820
- 'react/x-no-redundant-should-component-update'?: Linter.RuleEntry<[]>;
4821
4791
  /**
4822
4792
  * Disallows calling 'this.setState' in 'componentDidMount' outside functions such as callbacks.
4823
4793
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
@@ -4833,16 +4803,6 @@ interface RuleOptions {
4833
4803
  * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
4834
4804
  */
4835
4805
  'react/x-no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
4836
- /**
4837
- * Disallows unnecessary usage of 'useCallback'.
4838
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
4839
- */
4840
- 'react/x-no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
4841
- /**
4842
- * Disallows unnecessary usage of 'useMemo'.
4843
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
4844
- */
4845
- 'react/x-no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
4846
4806
  /**
4847
4807
  * Enforces that a function with the 'use' prefix uses at least one Hook inside it.
4848
4808
  * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
@@ -4883,26 +4843,11 @@ interface RuleOptions {
4883
4843
  * @see https://eslint-react.xyz/docs/rules/no-unused-props
4884
4844
  */
4885
4845
  'react/x-no-unused-props'?: Linter.RuleEntry<[]>;
4886
- /**
4887
- * Warns about unused class component state.
4888
- * @see https://eslint-react.xyz/docs/rules/no-unused-state
4889
- */
4890
- 'react/x-no-unused-state'?: Linter.RuleEntry<[]>;
4891
4846
  /**
4892
4847
  * Replaces usage of 'useContext' with 'use'.
4893
4848
  * @see https://eslint-react.xyz/docs/rules/no-use-context
4894
4849
  */
4895
4850
  'react/x-no-use-context'?: Linter.RuleEntry<[]>;
4896
- /**
4897
- * Enforces destructuring assignment for component props and context.
4898
- * @see https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment
4899
- */
4900
- 'react/x-prefer-destructuring-assignment'?: Linter.RuleEntry<[]>;
4901
- /**
4902
- * Enforces importing React via a namespace import.
4903
- * @see https://eslint-react.xyz/docs/rules/prefer-namespace-import
4904
- */
4905
- 'react/x-prefer-namespace-import'?: Linter.RuleEntry<[]>;
4906
4851
  /**
4907
4852
  * Validates that components and hooks are pure by checking that they do not call known-impure functions during render.
4908
4853
  * @see https://eslint-react.xyz/docs/rules/purity
@@ -4928,6 +4873,11 @@ interface RuleOptions {
4928
4873
  * @see https://eslint-react.xyz/docs/rules/set-state-in-render
4929
4874
  */
4930
4875
  'react/x-set-state-in-render'?: Linter.RuleEntry<[]>;
4876
+ /**
4877
+ * Validates that components are static, not recreated every render.
4878
+ * @see https://eslint-react.xyz/docs/rules/static-components
4879
+ */
4880
+ 'react/x-static-components'?: Linter.RuleEntry<[]>;
4931
4881
  /**
4932
4882
  * Validates against syntax that React Compiler does not support.
4933
4883
  * @see https://eslint-react.xyz/docs/rules/unsupported-syntax
package/dist/index.mjs CHANGED
@@ -1010,7 +1010,7 @@ async function react(options = {}) {
1010
1010
  "react/no-leaked-conditional-rendering": "error",
1011
1011
  "react/no-missing-component-display-name": "warn",
1012
1012
  "react/no-unstable-context-value": "warn",
1013
- "react/no-unstable-default-props": "error",
1013
+ "react/no-unstable-default-props": "warn",
1014
1014
  "react/no-unused-props": "warn",
1015
1015
  "react/refs": "warn",
1016
1016
  ...overrides
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ncontiero/eslint-config",
3
3
  "type": "module",
4
- "version": "7.3.0-beta.1",
4
+ "version": "7.3.0-beta.2",
5
5
  "packageManager": "pnpm@10.33.2",
6
6
  "description": "Nicolas's ESLint config.",
7
7
  "author": {
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
55
- "@eslint-react/eslint-plugin": "^4.2.3",
55
+ "@eslint-react/eslint-plugin": "5.5.1-beta.1",
56
56
  "@eslint/markdown": "^8.0.1",
57
57
  "@html-eslint/eslint-plugin": "^0.59.0",
58
58
  "@html-eslint/parser": "^0.59.0",