@ncontiero/eslint-config 6.2.1 → 6.3.0-beta.1

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +220 -2
  2. package/package.json +25 -23
package/dist/index.d.ts CHANGED
@@ -3812,16 +3812,120 @@ interface RuleOptions {
3812
3812
  * @see https://eslint.org/docs/latest/rules/radix
3813
3813
  */
3814
3814
  'radix'?: Linter.RuleEntry<Radix>
3815
+ /**
3816
+ * Verifies that automatic effect dependencies are compiled if opted-in
3817
+ */
3818
+ 'react-hooks/automatic-effect-dependencies'?: Linter.RuleEntry<ReactHooksAutomaticEffectDependencies>
3819
+ /**
3820
+ * Validates against calling capitalized functions/methods instead of using JSX
3821
+ */
3822
+ 'react-hooks/capitalized-calls'?: Linter.RuleEntry<ReactHooksCapitalizedCalls>
3823
+ /**
3824
+ * Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level
3825
+ */
3826
+ 'react-hooks/component-hook-factories'?: Linter.RuleEntry<ReactHooksComponentHookFactories>
3827
+ /**
3828
+ * Validates the compiler configuration options
3829
+ */
3830
+ 'react-hooks/config'?: Linter.RuleEntry<ReactHooksConfig>
3831
+ /**
3832
+ * Validates usage of error boundaries instead of try/catch for errors in child components
3833
+ */
3834
+ 'react-hooks/error-boundaries'?: Linter.RuleEntry<ReactHooksErrorBoundaries>
3815
3835
  /**
3816
3836
  * verifies the list of dependencies for Hooks like useEffect and similar
3817
3837
  * @see https://github.com/facebook/react/issues/14920
3818
3838
  */
3819
3839
  'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>
3840
+ /**
3841
+ * Validates usage of fbt
3842
+ */
3843
+ 'react-hooks/fbt'?: Linter.RuleEntry<ReactHooksFbt>
3844
+ /**
3845
+ * Validates usage of `fire`
3846
+ */
3847
+ 'react-hooks/fire'?: Linter.RuleEntry<ReactHooksFire>
3848
+ /**
3849
+ * Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)
3850
+ */
3851
+ 'react-hooks/gating'?: Linter.RuleEntry<ReactHooksGating>
3852
+ /**
3853
+ * 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)
3854
+ */
3855
+ 'react-hooks/globals'?: Linter.RuleEntry<ReactHooksGlobals>
3856
+ /**
3857
+ * Validates the rules of hooks
3858
+ */
3859
+ 'react-hooks/hooks'?: Linter.RuleEntry<ReactHooksHooks>
3860
+ /**
3861
+ * 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)
3862
+ */
3863
+ 'react-hooks/immutability'?: Linter.RuleEntry<ReactHooksImmutability>
3864
+ /**
3865
+ * Validates against usage of libraries which are incompatible with memoization (manual or automatic)
3866
+ */
3867
+ 'react-hooks/incompatible-library'?: Linter.RuleEntry<ReactHooksIncompatibleLibrary>
3868
+ /**
3869
+ * Internal invariants
3870
+ */
3871
+ 'react-hooks/invariant'?: Linter.RuleEntry<ReactHooksInvariant>
3872
+ /**
3873
+ * Validates that effect dependencies are memoized
3874
+ */
3875
+ 'react-hooks/memoized-effect-dependencies'?: Linter.RuleEntry<ReactHooksMemoizedEffectDependencies>
3876
+ /**
3877
+ * Validates against deriving values from state in an effect
3878
+ */
3879
+ 'react-hooks/no-deriving-state-in-effects'?: Linter.RuleEntry<ReactHooksNoDerivingStateInEffects>
3880
+ /**
3881
+ * 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)
3882
+ */
3883
+ 'react-hooks/preserve-manual-memoization'?: Linter.RuleEntry<ReactHooksPreserveManualMemoization>
3884
+ /**
3885
+ * 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
3886
+ */
3887
+ 'react-hooks/purity'?: Linter.RuleEntry<ReactHooksPurity>
3888
+ /**
3889
+ * Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
3890
+ */
3891
+ 'react-hooks/refs'?: Linter.RuleEntry<ReactHooksRefs>
3892
+ /**
3893
+ * Validates against suppression of other rules
3894
+ */
3895
+ 'react-hooks/rule-suppression'?: Linter.RuleEntry<ReactHooksRuleSuppression>
3820
3896
  /**
3821
3897
  * enforces the Rules of Hooks
3822
- * @see https://reactjs.org/docs/hooks-rules.html
3898
+ * @see https://react.dev/reference/rules/rules-of-hooks
3899
+ */
3900
+ 'react-hooks/rules-of-hooks'?: Linter.RuleEntry<ReactHooksRulesOfHooks>
3901
+ /**
3902
+ * Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
3903
+ */
3904
+ 'react-hooks/set-state-in-effect'?: Linter.RuleEntry<ReactHooksSetStateInEffect>
3905
+ /**
3906
+ * Validates against setting state during render, which can trigger additional renders and potential infinite render loops
3823
3907
  */
3824
- 'react-hooks/rules-of-hooks'?: Linter.RuleEntry<[]>
3908
+ 'react-hooks/set-state-in-render'?: Linter.RuleEntry<ReactHooksSetStateInRender>
3909
+ /**
3910
+ * Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
3911
+ */
3912
+ 'react-hooks/static-components'?: Linter.RuleEntry<ReactHooksStaticComponents>
3913
+ /**
3914
+ * Validates against invalid syntax
3915
+ */
3916
+ 'react-hooks/syntax'?: Linter.RuleEntry<ReactHooksSyntax>
3917
+ /**
3918
+ * Unimplemented features
3919
+ */
3920
+ 'react-hooks/todo'?: Linter.RuleEntry<ReactHooksTodo>
3921
+ /**
3922
+ * Validates against syntax that we do not plan to support in React Compiler
3923
+ */
3924
+ 'react-hooks/unsupported-syntax'?: Linter.RuleEntry<ReactHooksUnsupportedSyntax>
3925
+ /**
3926
+ * Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
3927
+ */
3928
+ 'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>
3825
3929
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
3826
3930
  /**
3827
3931
  * Enforces consistent naming for boolean props
@@ -9715,12 +9819,16 @@ type NoRestrictedImports = ((string | {
9715
9819
  message?: string
9716
9820
  importNames?: string[]
9717
9821
  allowImportNames?: string[]
9822
+
9823
+ allowTypeImports?: boolean
9718
9824
  })[] | []|[{
9719
9825
  paths?: (string | {
9720
9826
  name: string
9721
9827
  message?: string
9722
9828
  importNames?: string[]
9723
9829
  allowImportNames?: string[]
9830
+
9831
+ allowTypeImports?: boolean
9724
9832
  })[]
9725
9833
  patterns?: (string[] | ({
9726
9834
  [k: string]: unknown | undefined
@@ -13249,10 +13357,120 @@ type Quotes = []|[("single" | "double" | "backtick")]|[("single" | "double" | "b
13249
13357
  })]
13250
13358
  // ----- radix -----
13251
13359
  type Radix = []|[("always" | "as-needed")]
13360
+ // ----- react-hooks/automatic-effect-dependencies -----
13361
+ type ReactHooksAutomaticEffectDependencies = []|[{
13362
+ [k: string]: unknown | undefined
13363
+ }]
13364
+ // ----- react-hooks/capitalized-calls -----
13365
+ type ReactHooksCapitalizedCalls = []|[{
13366
+ [k: string]: unknown | undefined
13367
+ }]
13368
+ // ----- react-hooks/component-hook-factories -----
13369
+ type ReactHooksComponentHookFactories = []|[{
13370
+ [k: string]: unknown | undefined
13371
+ }]
13372
+ // ----- react-hooks/config -----
13373
+ type ReactHooksConfig = []|[{
13374
+ [k: string]: unknown | undefined
13375
+ }]
13376
+ // ----- react-hooks/error-boundaries -----
13377
+ type ReactHooksErrorBoundaries = []|[{
13378
+ [k: string]: unknown | undefined
13379
+ }]
13252
13380
  // ----- react-hooks/exhaustive-deps -----
13253
13381
  type ReactHooksExhaustiveDeps = []|[{
13254
13382
  additionalHooks?: string
13255
13383
  enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean
13384
+ experimental_autoDependenciesHooks?: string[]
13385
+ requireExplicitEffectDeps?: boolean
13386
+ }]
13387
+ // ----- react-hooks/fbt -----
13388
+ type ReactHooksFbt = []|[{
13389
+ [k: string]: unknown | undefined
13390
+ }]
13391
+ // ----- react-hooks/fire -----
13392
+ type ReactHooksFire = []|[{
13393
+ [k: string]: unknown | undefined
13394
+ }]
13395
+ // ----- react-hooks/gating -----
13396
+ type ReactHooksGating = []|[{
13397
+ [k: string]: unknown | undefined
13398
+ }]
13399
+ // ----- react-hooks/globals -----
13400
+ type ReactHooksGlobals = []|[{
13401
+ [k: string]: unknown | undefined
13402
+ }]
13403
+ // ----- react-hooks/hooks -----
13404
+ type ReactHooksHooks = []|[{
13405
+ [k: string]: unknown | undefined
13406
+ }]
13407
+ // ----- react-hooks/immutability -----
13408
+ type ReactHooksImmutability = []|[{
13409
+ [k: string]: unknown | undefined
13410
+ }]
13411
+ // ----- react-hooks/incompatible-library -----
13412
+ type ReactHooksIncompatibleLibrary = []|[{
13413
+ [k: string]: unknown | undefined
13414
+ }]
13415
+ // ----- react-hooks/invariant -----
13416
+ type ReactHooksInvariant = []|[{
13417
+ [k: string]: unknown | undefined
13418
+ }]
13419
+ // ----- react-hooks/memoized-effect-dependencies -----
13420
+ type ReactHooksMemoizedEffectDependencies = []|[{
13421
+ [k: string]: unknown | undefined
13422
+ }]
13423
+ // ----- react-hooks/no-deriving-state-in-effects -----
13424
+ type ReactHooksNoDerivingStateInEffects = []|[{
13425
+ [k: string]: unknown | undefined
13426
+ }]
13427
+ // ----- react-hooks/preserve-manual-memoization -----
13428
+ type ReactHooksPreserveManualMemoization = []|[{
13429
+ [k: string]: unknown | undefined
13430
+ }]
13431
+ // ----- react-hooks/purity -----
13432
+ type ReactHooksPurity = []|[{
13433
+ [k: string]: unknown | undefined
13434
+ }]
13435
+ // ----- react-hooks/refs -----
13436
+ type ReactHooksRefs = []|[{
13437
+ [k: string]: unknown | undefined
13438
+ }]
13439
+ // ----- react-hooks/rule-suppression -----
13440
+ type ReactHooksRuleSuppression = []|[{
13441
+ [k: string]: unknown | undefined
13442
+ }]
13443
+ // ----- react-hooks/rules-of-hooks -----
13444
+ type ReactHooksRulesOfHooks = []|[{
13445
+ additionalHooks?: string
13446
+ }]
13447
+ // ----- react-hooks/set-state-in-effect -----
13448
+ type ReactHooksSetStateInEffect = []|[{
13449
+ [k: string]: unknown | undefined
13450
+ }]
13451
+ // ----- react-hooks/set-state-in-render -----
13452
+ type ReactHooksSetStateInRender = []|[{
13453
+ [k: string]: unknown | undefined
13454
+ }]
13455
+ // ----- react-hooks/static-components -----
13456
+ type ReactHooksStaticComponents = []|[{
13457
+ [k: string]: unknown | undefined
13458
+ }]
13459
+ // ----- react-hooks/syntax -----
13460
+ type ReactHooksSyntax = []|[{
13461
+ [k: string]: unknown | undefined
13462
+ }]
13463
+ // ----- react-hooks/todo -----
13464
+ type ReactHooksTodo = []|[{
13465
+ [k: string]: unknown | undefined
13466
+ }]
13467
+ // ----- react-hooks/unsupported-syntax -----
13468
+ type ReactHooksUnsupportedSyntax = []|[{
13469
+ [k: string]: unknown | undefined
13470
+ }]
13471
+ // ----- react-hooks/use-memo -----
13472
+ type ReactHooksUseMemo = []|[{
13473
+ [k: string]: unknown | undefined
13256
13474
  }]
13257
13475
  // ----- react-refresh/only-export-components -----
13258
13476
  type ReactRefreshOnlyExportComponents = []|[{
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@ncontiero/eslint-config",
3
3
  "type": "module",
4
- "version": "6.2.1",
4
+ "version": "6.3.0-beta.1",
5
+ "packageManager": "pnpm@10.18.0",
5
6
  "description": "Nicolas's ESLint config.",
6
7
  "author": {
7
8
  "name": "Nicolas Contiero",
@@ -27,6 +28,18 @@
27
28
  "publishConfig": {
28
29
  "access": "public"
29
30
  },
31
+ "scripts": {
32
+ "build": "pnpm typegen && tsup",
33
+ "dev": "pnpm dlx @eslint/config-inspector --config eslint-inspector.config.ts",
34
+ "build:inspector": "pnpm build && pnpm dlx @eslint/config-inspector build --config eslint-inspector.config.ts",
35
+ "typegen": "tsx scripts/typegen.ts",
36
+ "lint": "eslint .",
37
+ "lint:fix": "pnpm lint --fix",
38
+ "changeset": "changeset",
39
+ "test": "vitest",
40
+ "typecheck": "tsc --noEmit",
41
+ "prepare": "husky"
42
+ },
30
43
  "peerDependencies": {
31
44
  "@tanstack/eslint-plugin-query": ">=5.50.0",
32
45
  "eslint": ">=9.20.0"
@@ -48,22 +61,22 @@
48
61
  "eslint-plugin-command": "^3.3.1",
49
62
  "eslint-plugin-de-morgan": "^2.0.0",
50
63
  "eslint-plugin-import-x": "^4.16.1",
51
- "eslint-plugin-jsdoc": "^60.7.0",
52
- "eslint-plugin-jsonc": "^2.20.1",
64
+ "eslint-plugin-jsdoc": "^60.8.0",
65
+ "eslint-plugin-jsonc": "^2.21.0",
53
66
  "eslint-plugin-jsx-a11y": "^6.10.2",
54
67
  "eslint-plugin-n": "^17.23.1",
55
- "eslint-plugin-perfectionist": "^4.15.0",
68
+ "eslint-plugin-perfectionist": "^4.15.1",
56
69
  "eslint-plugin-prettier": "^5.5.4",
57
70
  "eslint-plugin-promise": "^7.2.1",
58
71
  "eslint-plugin-react": "^7.37.5",
59
- "eslint-plugin-react-hooks": "^5.2.0",
60
- "eslint-plugin-react-refresh": "^0.4.22",
72
+ "eslint-plugin-react-hooks": "^6.1.1",
73
+ "eslint-plugin-react-refresh": "^0.4.23",
61
74
  "eslint-plugin-regexp": "^2.10.0",
62
75
  "eslint-plugin-tailwindcss": "^3.18.2",
63
76
  "eslint-plugin-toml": "^0.12.0",
64
77
  "eslint-plugin-unicorn": "^61.0.2",
65
78
  "eslint-plugin-unused-imports": "^4.2.0",
66
- "eslint-plugin-yml": "^1.18.0",
79
+ "eslint-plugin-yml": "^1.19.0",
67
80
  "globals": "^16.4.0",
68
81
  "jsonc-eslint-parser": "^2.4.1",
69
82
  "local-pkg": "^1.1.2",
@@ -78,9 +91,9 @@
78
91
  "@ncontiero/changelog-github": "^2.1.1",
79
92
  "@ncontiero/prettier-config": "^1.0.0",
80
93
  "@tanstack/eslint-plugin-query": "^5.91.0",
81
- "@types/eslint-plugin-jsx-a11y": "^6.10.0",
82
- "@types/node": "^24.6.1",
83
- "eslint": "^9.36.0",
94
+ "@types/eslint-plugin-jsx-a11y": "^6.10.1",
95
+ "@types/node": "^24.6.2",
96
+ "eslint": "^9.37.0",
84
97
  "eslint-typegen": "^2.3.0",
85
98
  "execa": "^9.6.0",
86
99
  "husky": "^9.1.7",
@@ -97,16 +110,5 @@
97
110
  "lint-staged": {
98
111
  "*": "pnpm lint:fix"
99
112
  },
100
- "prettier": "@ncontiero/prettier-config",
101
- "scripts": {
102
- "build": "pnpm typegen && tsup",
103
- "dev": "pnpm dlx @eslint/config-inspector --config eslint-inspector.config.ts",
104
- "build:inspector": "pnpm build && pnpm dlx @eslint/config-inspector build --config eslint-inspector.config.ts",
105
- "typegen": "tsx scripts/typegen.ts",
106
- "lint": "eslint .",
107
- "lint:fix": "pnpm lint --fix",
108
- "changeset": "changeset",
109
- "test": "vitest",
110
- "typecheck": "tsc --noEmit"
111
- }
112
- }
113
+ "prettier": "@ncontiero/prettier-config"
114
+ }