acaleph-eslint 1.1.3 → 1.1.5
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.cjs +48 -83
- package/dist/index.d.cts +1 -244
- package/dist/index.d.ts +1 -244
- package/dist/index.js +48 -83
- package/package.json +1 -3
package/dist/index.cjs
CHANGED
|
@@ -12909,7 +12909,7 @@ async function jsonc(options = {}) {
|
|
|
12909
12909
|
const pluginJsonc = await interopDefault(import("eslint-plugin-jsonc"));
|
|
12910
12910
|
return [
|
|
12911
12911
|
{
|
|
12912
|
-
name: "
|
|
12912
|
+
name: "acaleph/jsonc/setup",
|
|
12913
12913
|
plugins: {
|
|
12914
12914
|
jsonc: pluginJsonc
|
|
12915
12915
|
}
|
|
@@ -12976,7 +12976,7 @@ async function jsx(options = {}) {
|
|
|
12976
12976
|
}
|
|
12977
12977
|
}
|
|
12978
12978
|
},
|
|
12979
|
-
name: "
|
|
12979
|
+
name: "acaleph/jsx/setup",
|
|
12980
12980
|
plugins: {},
|
|
12981
12981
|
rules: {}
|
|
12982
12982
|
};
|
|
@@ -13330,21 +13330,16 @@ var ReactRouterPackages = [
|
|
|
13330
13330
|
var NextJsPackages = [
|
|
13331
13331
|
"next"
|
|
13332
13332
|
];
|
|
13333
|
-
var ReactCompilerPackages = [
|
|
13334
|
-
"babel-plugin-react-compiler"
|
|
13335
|
-
];
|
|
13336
13333
|
async function react(options = {}) {
|
|
13337
13334
|
const {
|
|
13338
13335
|
files = [GLOB_SRC],
|
|
13339
13336
|
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
13340
13337
|
ignoresTypeAware = [],
|
|
13341
13338
|
overrides = {},
|
|
13342
|
-
reactCompiler = ReactCompilerPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i)),
|
|
13343
13339
|
tsconfigPath
|
|
13344
13340
|
} = options;
|
|
13345
13341
|
await ensurePackages([
|
|
13346
13342
|
"@eslint-react/eslint-plugin",
|
|
13347
|
-
"eslint-plugin-react-hooks",
|
|
13348
13343
|
"eslint-plugin-react-refresh"
|
|
13349
13344
|
]);
|
|
13350
13345
|
const isTypeAware = !!tsconfigPath;
|
|
@@ -13354,11 +13349,9 @@ async function react(options = {}) {
|
|
|
13354
13349
|
};
|
|
13355
13350
|
const [
|
|
13356
13351
|
pluginReact,
|
|
13357
|
-
pluginReactHooks,
|
|
13358
13352
|
pluginReactRefresh
|
|
13359
13353
|
] = await Promise.all([
|
|
13360
13354
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
13361
|
-
interopDefault(import("eslint-plugin-react-hooks")),
|
|
13362
13355
|
interopDefault(import("eslint-plugin-react-refresh"))
|
|
13363
13356
|
]);
|
|
13364
13357
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
|
|
@@ -13372,8 +13365,6 @@ async function react(options = {}) {
|
|
|
13372
13365
|
plugins: {
|
|
13373
13366
|
"react": plugins["@eslint-react"],
|
|
13374
13367
|
"react-dom": plugins["@eslint-react/dom"],
|
|
13375
|
-
"react-hooks": pluginReactHooks,
|
|
13376
|
-
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
13377
13368
|
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
13378
13369
|
"react-refresh": pluginReactRefresh,
|
|
13379
13370
|
"react-rsc": plugins["@eslint-react/rsc"],
|
|
@@ -13392,6 +13383,48 @@ async function react(options = {}) {
|
|
|
13392
13383
|
},
|
|
13393
13384
|
name: "acaleph/react/rules",
|
|
13394
13385
|
rules: {
|
|
13386
|
+
...pluginReact.configs.recommended.rules,
|
|
13387
|
+
"react-refresh/only-export-components": [
|
|
13388
|
+
"error",
|
|
13389
|
+
{
|
|
13390
|
+
allowConstantExport: isAllowConstantExport,
|
|
13391
|
+
allowExportNames: [
|
|
13392
|
+
...isUsingNext ? [
|
|
13393
|
+
// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
|
|
13394
|
+
"dynamic",
|
|
13395
|
+
"dynamicParams",
|
|
13396
|
+
"revalidate",
|
|
13397
|
+
"fetchCache",
|
|
13398
|
+
"runtime",
|
|
13399
|
+
"preferredRegion",
|
|
13400
|
+
"maxDuration",
|
|
13401
|
+
// https://nextjs.org/docs/app/api-reference/functions/generate-static-params
|
|
13402
|
+
"generateStaticParams",
|
|
13403
|
+
// https://nextjs.org/docs/app/api-reference/functions/generate-metadata
|
|
13404
|
+
"metadata",
|
|
13405
|
+
"generateMetadata",
|
|
13406
|
+
// https://nextjs.org/docs/app/api-reference/functions/generate-viewport
|
|
13407
|
+
"viewport",
|
|
13408
|
+
"generateViewport",
|
|
13409
|
+
// https://nextjs.org/docs/app/api-reference/functions/generate-image-metadata
|
|
13410
|
+
"generateImageMetadata",
|
|
13411
|
+
// https://nextjs.org/docs/app/api-reference/functions/generate-sitemaps
|
|
13412
|
+
"generateSitemaps"
|
|
13413
|
+
] : [],
|
|
13414
|
+
...isUsingRemix || isUsingReactRouter ? [
|
|
13415
|
+
"meta",
|
|
13416
|
+
"links",
|
|
13417
|
+
"headers",
|
|
13418
|
+
"loader",
|
|
13419
|
+
"action",
|
|
13420
|
+
"clientLoader",
|
|
13421
|
+
"clientAction",
|
|
13422
|
+
"handle",
|
|
13423
|
+
"shouldRevalidate"
|
|
13424
|
+
] : []
|
|
13425
|
+
]
|
|
13426
|
+
}
|
|
13427
|
+
],
|
|
13395
13428
|
// recommended rules from eslint-plugin-react-dom https://eslint-react.xyz/docs/rules/overview#dom-rules
|
|
13396
13429
|
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
13397
13430
|
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
@@ -13405,18 +13438,10 @@ async function react(options = {}) {
|
|
|
13405
13438
|
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
13406
13439
|
"react-dom/no-use-form-state": "error",
|
|
13407
13440
|
"react-dom/no-void-elements-with-children": "error",
|
|
13408
|
-
// recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
|
|
13409
|
-
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
13410
|
-
"react-hooks/exhaustive-deps": "warn",
|
|
13411
|
-
// recommended rules eslint-plugin-react-hooks https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md
|
|
13412
|
-
// Core hooks rules
|
|
13413
|
-
"react-hooks/rules-of-hooks": "error",
|
|
13414
13441
|
// recommended rules from eslint-plugin-react-naming-convention https://eslint-react.xyz/docs/rules/overview#naming-convention-rules
|
|
13415
13442
|
"react-naming-convention/context-name": "warn",
|
|
13416
13443
|
"react-naming-convention/ref-name": "warn",
|
|
13417
13444
|
"react-naming-convention/use-state": "warn",
|
|
13418
|
-
// recommended rules from eslint-plugin-react-rsc https://eslint-react.xyz/docs/rules/overview#rsc-rules
|
|
13419
|
-
"react-rsc/function-definition": "error",
|
|
13420
13445
|
// recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
|
|
13421
13446
|
"react-web-api/no-leaked-event-listener": "warn",
|
|
13422
13447
|
"react-web-api/no-leaked-interval": "warn",
|
|
@@ -13462,66 +13487,6 @@ async function react(options = {}) {
|
|
|
13462
13487
|
"react/no-useless-forward-ref": "warn",
|
|
13463
13488
|
"react/prefer-namespace-import": "error",
|
|
13464
13489
|
"react/prefer-use-state-lazy-initialization": "warn",
|
|
13465
|
-
// React Compiler rules
|
|
13466
|
-
...reactCompiler ? {
|
|
13467
|
-
"react-hooks/component-hook-factories": "error",
|
|
13468
|
-
"react-hooks/config": "error",
|
|
13469
|
-
"react-hooks/error-boundaries": "error",
|
|
13470
|
-
"react-hooks/gating": "error",
|
|
13471
|
-
"react-hooks/globals": "error",
|
|
13472
|
-
"react-hooks/immutability": "error",
|
|
13473
|
-
"react-hooks/incompatible-library": "warn",
|
|
13474
|
-
"react-hooks/preserve-manual-memoization": "error",
|
|
13475
|
-
"react-hooks/purity": "error",
|
|
13476
|
-
"react-hooks/refs": "error",
|
|
13477
|
-
"react-hooks/set-state-in-effect": "error",
|
|
13478
|
-
"react-hooks/set-state-in-render": "error",
|
|
13479
|
-
"react-hooks/static-components": "error",
|
|
13480
|
-
"react-hooks/unsupported-syntax": "warn",
|
|
13481
|
-
"react-hooks/use-memo": "error"
|
|
13482
|
-
} : {},
|
|
13483
|
-
// preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
|
|
13484
|
-
"react-refresh/only-export-components": [
|
|
13485
|
-
"error",
|
|
13486
|
-
{
|
|
13487
|
-
allowConstantExport: isAllowConstantExport,
|
|
13488
|
-
allowExportNames: [
|
|
13489
|
-
...isUsingNext ? [
|
|
13490
|
-
// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
|
|
13491
|
-
"dynamic",
|
|
13492
|
-
"dynamicParams",
|
|
13493
|
-
"revalidate",
|
|
13494
|
-
"fetchCache",
|
|
13495
|
-
"runtime",
|
|
13496
|
-
"preferredRegion",
|
|
13497
|
-
"maxDuration",
|
|
13498
|
-
// https://nextjs.org/docs/app/api-reference/functions/generate-static-params
|
|
13499
|
-
"generateStaticParams",
|
|
13500
|
-
// https://nextjs.org/docs/app/api-reference/functions/generate-metadata
|
|
13501
|
-
"metadata",
|
|
13502
|
-
"generateMetadata",
|
|
13503
|
-
// https://nextjs.org/docs/app/api-reference/functions/generate-viewport
|
|
13504
|
-
"viewport",
|
|
13505
|
-
"generateViewport",
|
|
13506
|
-
// https://nextjs.org/docs/app/api-reference/functions/generate-image-metadata
|
|
13507
|
-
"generateImageMetadata",
|
|
13508
|
-
// https://nextjs.org/docs/app/api-reference/functions/generate-sitemaps
|
|
13509
|
-
"generateSitemaps"
|
|
13510
|
-
] : [],
|
|
13511
|
-
...isUsingRemix || isUsingReactRouter ? [
|
|
13512
|
-
"meta",
|
|
13513
|
-
"links",
|
|
13514
|
-
"headers",
|
|
13515
|
-
"loader",
|
|
13516
|
-
"action",
|
|
13517
|
-
"clientLoader",
|
|
13518
|
-
"clientAction",
|
|
13519
|
-
"handle",
|
|
13520
|
-
"shouldRevalidate"
|
|
13521
|
-
] : []
|
|
13522
|
-
]
|
|
13523
|
-
}
|
|
13524
|
-
],
|
|
13525
13490
|
...overrides
|
|
13526
13491
|
}
|
|
13527
13492
|
},
|
|
@@ -13541,7 +13506,7 @@ async function react(options = {}) {
|
|
|
13541
13506
|
...isTypeAware ? [{
|
|
13542
13507
|
files: filesTypeAware,
|
|
13543
13508
|
ignores: ignoresTypeAware,
|
|
13544
|
-
name: "
|
|
13509
|
+
name: "acaleph/react/type-aware-rules",
|
|
13545
13510
|
rules: {
|
|
13546
13511
|
...typeAwareRules
|
|
13547
13512
|
}
|
|
@@ -14557,14 +14522,14 @@ function acaleph(options = {}, ...userConfigs) {
|
|
|
14557
14522
|
if (typeof enableGitignore !== "boolean") {
|
|
14558
14523
|
configs2.push(
|
|
14559
14524
|
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
|
|
14560
|
-
name: "
|
|
14525
|
+
name: "acaleph/gitignore",
|
|
14561
14526
|
...enableGitignore
|
|
14562
14527
|
})])
|
|
14563
14528
|
);
|
|
14564
14529
|
} else {
|
|
14565
14530
|
configs2.push(
|
|
14566
14531
|
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
|
|
14567
|
-
name: "
|
|
14532
|
+
name: "acaleph/gitignore",
|
|
14568
14533
|
strict: false
|
|
14569
14534
|
})])
|
|
14570
14535
|
);
|
|
@@ -14719,7 +14684,7 @@ function acaleph(options = {}, ...userConfigs) {
|
|
|
14719
14684
|
disables()
|
|
14720
14685
|
);
|
|
14721
14686
|
if ("files" in options) {
|
|
14722
|
-
throw new Error('[
|
|
14687
|
+
throw new Error('[acaleph-eslint] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');
|
|
14723
14688
|
}
|
|
14724
14689
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
|
14725
14690
|
if (key in options) {
|
package/dist/index.d.cts
CHANGED
|
@@ -530,129 +530,6 @@ interface RuleOptions {
|
|
|
530
530
|
* @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
|
|
531
531
|
*/
|
|
532
532
|
'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>
|
|
533
|
-
/**
|
|
534
|
-
* Disallows direct calls to the ['set' function](https://react.dev/reference/react/useState#setstate) of 'useState' in 'useEffect'.
|
|
535
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
|
|
536
|
-
*/
|
|
537
|
-
'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>
|
|
538
|
-
/**
|
|
539
|
-
* Verifies that automatic effect dependencies are compiled if opted-in
|
|
540
|
-
*/
|
|
541
|
-
'react-hooks/automatic-effect-dependencies'?: Linter.RuleEntry<ReactHooksAutomaticEffectDependencies>
|
|
542
|
-
/**
|
|
543
|
-
* Validates against calling capitalized functions/methods instead of using JSX
|
|
544
|
-
*/
|
|
545
|
-
'react-hooks/capitalized-calls'?: Linter.RuleEntry<ReactHooksCapitalizedCalls>
|
|
546
|
-
/**
|
|
547
|
-
* Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level
|
|
548
|
-
*/
|
|
549
|
-
'react-hooks/component-hook-factories'?: Linter.RuleEntry<ReactHooksComponentHookFactories>
|
|
550
|
-
/**
|
|
551
|
-
* Validates the compiler configuration options
|
|
552
|
-
*/
|
|
553
|
-
'react-hooks/config'?: Linter.RuleEntry<ReactHooksConfig>
|
|
554
|
-
/**
|
|
555
|
-
* Validates usage of error boundaries instead of try/catch for errors in child components
|
|
556
|
-
*/
|
|
557
|
-
'react-hooks/error-boundaries'?: Linter.RuleEntry<ReactHooksErrorBoundaries>
|
|
558
|
-
/**
|
|
559
|
-
* verifies the list of dependencies for Hooks like useEffect and similar
|
|
560
|
-
* @see https://github.com/facebook/react/issues/14920
|
|
561
|
-
*/
|
|
562
|
-
'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>
|
|
563
|
-
/**
|
|
564
|
-
* Validates usage of fbt
|
|
565
|
-
*/
|
|
566
|
-
'react-hooks/fbt'?: Linter.RuleEntry<ReactHooksFbt>
|
|
567
|
-
/**
|
|
568
|
-
* Validates usage of `fire`
|
|
569
|
-
*/
|
|
570
|
-
'react-hooks/fire'?: Linter.RuleEntry<ReactHooksFire>
|
|
571
|
-
/**
|
|
572
|
-
* Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)
|
|
573
|
-
*/
|
|
574
|
-
'react-hooks/gating'?: Linter.RuleEntry<ReactHooksGating>
|
|
575
|
-
/**
|
|
576
|
-
* 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)
|
|
577
|
-
*/
|
|
578
|
-
'react-hooks/globals'?: Linter.RuleEntry<ReactHooksGlobals>
|
|
579
|
-
/**
|
|
580
|
-
* Validates the rules of hooks
|
|
581
|
-
*/
|
|
582
|
-
'react-hooks/hooks'?: Linter.RuleEntry<ReactHooksHooks>
|
|
583
|
-
/**
|
|
584
|
-
* 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)
|
|
585
|
-
*/
|
|
586
|
-
'react-hooks/immutability'?: Linter.RuleEntry<ReactHooksImmutability>
|
|
587
|
-
/**
|
|
588
|
-
* Validates against usage of libraries which are incompatible with memoization (manual or automatic)
|
|
589
|
-
*/
|
|
590
|
-
'react-hooks/incompatible-library'?: Linter.RuleEntry<ReactHooksIncompatibleLibrary>
|
|
591
|
-
/**
|
|
592
|
-
* Internal invariants
|
|
593
|
-
*/
|
|
594
|
-
'react-hooks/invariant'?: Linter.RuleEntry<ReactHooksInvariant>
|
|
595
|
-
/**
|
|
596
|
-
* Validates that effect dependencies are memoized
|
|
597
|
-
*/
|
|
598
|
-
'react-hooks/memoized-effect-dependencies'?: Linter.RuleEntry<ReactHooksMemoizedEffectDependencies>
|
|
599
|
-
/**
|
|
600
|
-
* Validates against deriving values from state in an effect
|
|
601
|
-
*/
|
|
602
|
-
'react-hooks/no-deriving-state-in-effects'?: Linter.RuleEntry<ReactHooksNoDerivingStateInEffects>
|
|
603
|
-
/**
|
|
604
|
-
* 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)
|
|
605
|
-
*/
|
|
606
|
-
'react-hooks/preserve-manual-memoization'?: Linter.RuleEntry<ReactHooksPreserveManualMemoization>
|
|
607
|
-
/**
|
|
608
|
-
* 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
|
|
609
|
-
*/
|
|
610
|
-
'react-hooks/purity'?: Linter.RuleEntry<ReactHooksPurity>
|
|
611
|
-
/**
|
|
612
|
-
* Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
|
|
613
|
-
*/
|
|
614
|
-
'react-hooks/refs'?: Linter.RuleEntry<ReactHooksRefs>
|
|
615
|
-
/**
|
|
616
|
-
* Validates against suppression of other rules
|
|
617
|
-
*/
|
|
618
|
-
'react-hooks/rule-suppression'?: Linter.RuleEntry<ReactHooksRuleSuppression>
|
|
619
|
-
/**
|
|
620
|
-
* enforces the Rules of Hooks
|
|
621
|
-
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
622
|
-
*/
|
|
623
|
-
'react-hooks/rules-of-hooks'?: Linter.RuleEntry<ReactHooksRulesOfHooks>
|
|
624
|
-
/**
|
|
625
|
-
* Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
|
|
626
|
-
*/
|
|
627
|
-
'react-hooks/set-state-in-effect'?: Linter.RuleEntry<ReactHooksSetStateInEffect>
|
|
628
|
-
/**
|
|
629
|
-
* Validates against setting state during render, which can trigger additional renders and potential infinite render loops
|
|
630
|
-
*/
|
|
631
|
-
'react-hooks/set-state-in-render'?: Linter.RuleEntry<ReactHooksSetStateInRender>
|
|
632
|
-
/**
|
|
633
|
-
* Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
|
|
634
|
-
*/
|
|
635
|
-
'react-hooks/static-components'?: Linter.RuleEntry<ReactHooksStaticComponents>
|
|
636
|
-
/**
|
|
637
|
-
* Validates against invalid syntax
|
|
638
|
-
*/
|
|
639
|
-
'react-hooks/syntax'?: Linter.RuleEntry<ReactHooksSyntax>
|
|
640
|
-
/**
|
|
641
|
-
* Unimplemented features
|
|
642
|
-
*/
|
|
643
|
-
'react-hooks/todo'?: Linter.RuleEntry<ReactHooksTodo>
|
|
644
|
-
/**
|
|
645
|
-
* Validates against syntax that we do not plan to support in React Compiler
|
|
646
|
-
*/
|
|
647
|
-
'react-hooks/unsupported-syntax'?: Linter.RuleEntry<ReactHooksUnsupportedSyntax>
|
|
648
|
-
/**
|
|
649
|
-
* Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
650
|
-
*/
|
|
651
|
-
'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>
|
|
652
|
-
/**
|
|
653
|
-
* Validates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
654
|
-
*/
|
|
655
|
-
'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>
|
|
656
533
|
/**
|
|
657
534
|
* Enforces naming conventions for components.
|
|
658
535
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-component-name
|
|
@@ -7785,125 +7662,6 @@ type ReactDomNoUnknownProperty = []|[{
|
|
|
7785
7662
|
ignore?: string[]
|
|
7786
7663
|
requireDataLowercase?: boolean
|
|
7787
7664
|
}]
|
|
7788
|
-
// ----- react-hooks/automatic-effect-dependencies -----
|
|
7789
|
-
type ReactHooksAutomaticEffectDependencies = []|[{
|
|
7790
|
-
[k: string]: unknown | undefined
|
|
7791
|
-
}]
|
|
7792
|
-
// ----- react-hooks/capitalized-calls -----
|
|
7793
|
-
type ReactHooksCapitalizedCalls = []|[{
|
|
7794
|
-
[k: string]: unknown | undefined
|
|
7795
|
-
}]
|
|
7796
|
-
// ----- react-hooks/component-hook-factories -----
|
|
7797
|
-
type ReactHooksComponentHookFactories = []|[{
|
|
7798
|
-
[k: string]: unknown | undefined
|
|
7799
|
-
}]
|
|
7800
|
-
// ----- react-hooks/config -----
|
|
7801
|
-
type ReactHooksConfig = []|[{
|
|
7802
|
-
[k: string]: unknown | undefined
|
|
7803
|
-
}]
|
|
7804
|
-
// ----- react-hooks/error-boundaries -----
|
|
7805
|
-
type ReactHooksErrorBoundaries = []|[{
|
|
7806
|
-
[k: string]: unknown | undefined
|
|
7807
|
-
}]
|
|
7808
|
-
// ----- react-hooks/exhaustive-deps -----
|
|
7809
|
-
type ReactHooksExhaustiveDeps = []|[{
|
|
7810
|
-
additionalHooks?: string
|
|
7811
|
-
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean
|
|
7812
|
-
experimental_autoDependenciesHooks?: string[]
|
|
7813
|
-
requireExplicitEffectDeps?: boolean
|
|
7814
|
-
}]
|
|
7815
|
-
// ----- react-hooks/fbt -----
|
|
7816
|
-
type ReactHooksFbt = []|[{
|
|
7817
|
-
[k: string]: unknown | undefined
|
|
7818
|
-
}]
|
|
7819
|
-
// ----- react-hooks/fire -----
|
|
7820
|
-
type ReactHooksFire = []|[{
|
|
7821
|
-
[k: string]: unknown | undefined
|
|
7822
|
-
}]
|
|
7823
|
-
// ----- react-hooks/gating -----
|
|
7824
|
-
type ReactHooksGating = []|[{
|
|
7825
|
-
[k: string]: unknown | undefined
|
|
7826
|
-
}]
|
|
7827
|
-
// ----- react-hooks/globals -----
|
|
7828
|
-
type ReactHooksGlobals = []|[{
|
|
7829
|
-
[k: string]: unknown | undefined
|
|
7830
|
-
}]
|
|
7831
|
-
// ----- react-hooks/hooks -----
|
|
7832
|
-
type ReactHooksHooks = []|[{
|
|
7833
|
-
[k: string]: unknown | undefined
|
|
7834
|
-
}]
|
|
7835
|
-
// ----- react-hooks/immutability -----
|
|
7836
|
-
type ReactHooksImmutability = []|[{
|
|
7837
|
-
[k: string]: unknown | undefined
|
|
7838
|
-
}]
|
|
7839
|
-
// ----- react-hooks/incompatible-library -----
|
|
7840
|
-
type ReactHooksIncompatibleLibrary = []|[{
|
|
7841
|
-
[k: string]: unknown | undefined
|
|
7842
|
-
}]
|
|
7843
|
-
// ----- react-hooks/invariant -----
|
|
7844
|
-
type ReactHooksInvariant = []|[{
|
|
7845
|
-
[k: string]: unknown | undefined
|
|
7846
|
-
}]
|
|
7847
|
-
// ----- react-hooks/memoized-effect-dependencies -----
|
|
7848
|
-
type ReactHooksMemoizedEffectDependencies = []|[{
|
|
7849
|
-
[k: string]: unknown | undefined
|
|
7850
|
-
}]
|
|
7851
|
-
// ----- react-hooks/no-deriving-state-in-effects -----
|
|
7852
|
-
type ReactHooksNoDerivingStateInEffects = []|[{
|
|
7853
|
-
[k: string]: unknown | undefined
|
|
7854
|
-
}]
|
|
7855
|
-
// ----- react-hooks/preserve-manual-memoization -----
|
|
7856
|
-
type ReactHooksPreserveManualMemoization = []|[{
|
|
7857
|
-
[k: string]: unknown | undefined
|
|
7858
|
-
}]
|
|
7859
|
-
// ----- react-hooks/purity -----
|
|
7860
|
-
type ReactHooksPurity = []|[{
|
|
7861
|
-
[k: string]: unknown | undefined
|
|
7862
|
-
}]
|
|
7863
|
-
// ----- react-hooks/refs -----
|
|
7864
|
-
type ReactHooksRefs = []|[{
|
|
7865
|
-
[k: string]: unknown | undefined
|
|
7866
|
-
}]
|
|
7867
|
-
// ----- react-hooks/rule-suppression -----
|
|
7868
|
-
type ReactHooksRuleSuppression = []|[{
|
|
7869
|
-
[k: string]: unknown | undefined
|
|
7870
|
-
}]
|
|
7871
|
-
// ----- react-hooks/rules-of-hooks -----
|
|
7872
|
-
type ReactHooksRulesOfHooks = []|[{
|
|
7873
|
-
additionalHooks?: string
|
|
7874
|
-
}]
|
|
7875
|
-
// ----- react-hooks/set-state-in-effect -----
|
|
7876
|
-
type ReactHooksSetStateInEffect = []|[{
|
|
7877
|
-
[k: string]: unknown | undefined
|
|
7878
|
-
}]
|
|
7879
|
-
// ----- react-hooks/set-state-in-render -----
|
|
7880
|
-
type ReactHooksSetStateInRender = []|[{
|
|
7881
|
-
[k: string]: unknown | undefined
|
|
7882
|
-
}]
|
|
7883
|
-
// ----- react-hooks/static-components -----
|
|
7884
|
-
type ReactHooksStaticComponents = []|[{
|
|
7885
|
-
[k: string]: unknown | undefined
|
|
7886
|
-
}]
|
|
7887
|
-
// ----- react-hooks/syntax -----
|
|
7888
|
-
type ReactHooksSyntax = []|[{
|
|
7889
|
-
[k: string]: unknown | undefined
|
|
7890
|
-
}]
|
|
7891
|
-
// ----- react-hooks/todo -----
|
|
7892
|
-
type ReactHooksTodo = []|[{
|
|
7893
|
-
[k: string]: unknown | undefined
|
|
7894
|
-
}]
|
|
7895
|
-
// ----- react-hooks/unsupported-syntax -----
|
|
7896
|
-
type ReactHooksUnsupportedSyntax = []|[{
|
|
7897
|
-
[k: string]: unknown | undefined
|
|
7898
|
-
}]
|
|
7899
|
-
// ----- react-hooks/use-memo -----
|
|
7900
|
-
type ReactHooksUseMemo = []|[{
|
|
7901
|
-
[k: string]: unknown | undefined
|
|
7902
|
-
}]
|
|
7903
|
-
// ----- react-hooks/void-use-memo -----
|
|
7904
|
-
type ReactHooksVoidUseMemo = []|[{
|
|
7905
|
-
[k: string]: unknown | undefined
|
|
7906
|
-
}]
|
|
7907
7665
|
// ----- react-naming-convention/component-name -----
|
|
7908
7666
|
type ReactNamingConventionComponentName = []|[(("PascalCase" | "CONSTANT_CASE") | {
|
|
7909
7667
|
allowAllCaps?: boolean
|
|
@@ -11692,7 +11450,7 @@ type VueValidVSlot = []|[{
|
|
|
11692
11450
|
allowModifiers?: boolean
|
|
11693
11451
|
}]
|
|
11694
11452
|
// Names of all the configs
|
|
11695
|
-
type ConfigNames = 'acaleph/javascript/setup' | 'acaleph/javascript/rules' | 'acaleph/typescript/setup' | 'acaleph/typescript/parser' | 'acaleph/typescript/rules' | 'acaleph/vue/setup' | 'acaleph/vue/rules' | 'acaleph/react/setup' | 'acaleph/react/rules' | 'acaleph/react/typescript' | '
|
|
11453
|
+
type ConfigNames = 'acaleph/javascript/setup' | 'acaleph/javascript/rules' | 'acaleph/typescript/setup' | 'acaleph/typescript/parser' | 'acaleph/typescript/rules' | 'acaleph/vue/setup' | 'acaleph/vue/rules' | 'acaleph/react/setup' | 'acaleph/react/rules' | 'acaleph/react/typescript' | 'acaleph/jsx/setup' | 'acaleph/stylistic/rules' | 'acaleph/imports/rules' | 'acaleph/perfectionist/setup' | 'acaleph/jsonc/setup' | 'acaleph/jsonc/rules'
|
|
11696
11454
|
|
|
11697
11455
|
/**
|
|
11698
11456
|
* Vendor types from Prettier so we don't rely on the dependency.
|
|
@@ -12074,7 +11832,6 @@ interface OptionsUnoCSS extends OptionsOverrides {
|
|
|
12074
11832
|
strict?: boolean;
|
|
12075
11833
|
}
|
|
12076
11834
|
interface OptionsReact extends OptionsOverrides {
|
|
12077
|
-
reactCompiler?: boolean;
|
|
12078
11835
|
}
|
|
12079
11836
|
interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
12080
11837
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -530,129 +530,6 @@ interface RuleOptions {
|
|
|
530
530
|
* @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
|
|
531
531
|
*/
|
|
532
532
|
'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>
|
|
533
|
-
/**
|
|
534
|
-
* Disallows direct calls to the ['set' function](https://react.dev/reference/react/useState#setstate) of 'useState' in 'useEffect'.
|
|
535
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
|
|
536
|
-
*/
|
|
537
|
-
'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>
|
|
538
|
-
/**
|
|
539
|
-
* Verifies that automatic effect dependencies are compiled if opted-in
|
|
540
|
-
*/
|
|
541
|
-
'react-hooks/automatic-effect-dependencies'?: Linter.RuleEntry<ReactHooksAutomaticEffectDependencies>
|
|
542
|
-
/**
|
|
543
|
-
* Validates against calling capitalized functions/methods instead of using JSX
|
|
544
|
-
*/
|
|
545
|
-
'react-hooks/capitalized-calls'?: Linter.RuleEntry<ReactHooksCapitalizedCalls>
|
|
546
|
-
/**
|
|
547
|
-
* Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level
|
|
548
|
-
*/
|
|
549
|
-
'react-hooks/component-hook-factories'?: Linter.RuleEntry<ReactHooksComponentHookFactories>
|
|
550
|
-
/**
|
|
551
|
-
* Validates the compiler configuration options
|
|
552
|
-
*/
|
|
553
|
-
'react-hooks/config'?: Linter.RuleEntry<ReactHooksConfig>
|
|
554
|
-
/**
|
|
555
|
-
* Validates usage of error boundaries instead of try/catch for errors in child components
|
|
556
|
-
*/
|
|
557
|
-
'react-hooks/error-boundaries'?: Linter.RuleEntry<ReactHooksErrorBoundaries>
|
|
558
|
-
/**
|
|
559
|
-
* verifies the list of dependencies for Hooks like useEffect and similar
|
|
560
|
-
* @see https://github.com/facebook/react/issues/14920
|
|
561
|
-
*/
|
|
562
|
-
'react-hooks/exhaustive-deps'?: Linter.RuleEntry<ReactHooksExhaustiveDeps>
|
|
563
|
-
/**
|
|
564
|
-
* Validates usage of fbt
|
|
565
|
-
*/
|
|
566
|
-
'react-hooks/fbt'?: Linter.RuleEntry<ReactHooksFbt>
|
|
567
|
-
/**
|
|
568
|
-
* Validates usage of `fire`
|
|
569
|
-
*/
|
|
570
|
-
'react-hooks/fire'?: Linter.RuleEntry<ReactHooksFire>
|
|
571
|
-
/**
|
|
572
|
-
* Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)
|
|
573
|
-
*/
|
|
574
|
-
'react-hooks/gating'?: Linter.RuleEntry<ReactHooksGating>
|
|
575
|
-
/**
|
|
576
|
-
* 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)
|
|
577
|
-
*/
|
|
578
|
-
'react-hooks/globals'?: Linter.RuleEntry<ReactHooksGlobals>
|
|
579
|
-
/**
|
|
580
|
-
* Validates the rules of hooks
|
|
581
|
-
*/
|
|
582
|
-
'react-hooks/hooks'?: Linter.RuleEntry<ReactHooksHooks>
|
|
583
|
-
/**
|
|
584
|
-
* 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)
|
|
585
|
-
*/
|
|
586
|
-
'react-hooks/immutability'?: Linter.RuleEntry<ReactHooksImmutability>
|
|
587
|
-
/**
|
|
588
|
-
* Validates against usage of libraries which are incompatible with memoization (manual or automatic)
|
|
589
|
-
*/
|
|
590
|
-
'react-hooks/incompatible-library'?: Linter.RuleEntry<ReactHooksIncompatibleLibrary>
|
|
591
|
-
/**
|
|
592
|
-
* Internal invariants
|
|
593
|
-
*/
|
|
594
|
-
'react-hooks/invariant'?: Linter.RuleEntry<ReactHooksInvariant>
|
|
595
|
-
/**
|
|
596
|
-
* Validates that effect dependencies are memoized
|
|
597
|
-
*/
|
|
598
|
-
'react-hooks/memoized-effect-dependencies'?: Linter.RuleEntry<ReactHooksMemoizedEffectDependencies>
|
|
599
|
-
/**
|
|
600
|
-
* Validates against deriving values from state in an effect
|
|
601
|
-
*/
|
|
602
|
-
'react-hooks/no-deriving-state-in-effects'?: Linter.RuleEntry<ReactHooksNoDerivingStateInEffects>
|
|
603
|
-
/**
|
|
604
|
-
* 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)
|
|
605
|
-
*/
|
|
606
|
-
'react-hooks/preserve-manual-memoization'?: Linter.RuleEntry<ReactHooksPreserveManualMemoization>
|
|
607
|
-
/**
|
|
608
|
-
* 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
|
|
609
|
-
*/
|
|
610
|
-
'react-hooks/purity'?: Linter.RuleEntry<ReactHooksPurity>
|
|
611
|
-
/**
|
|
612
|
-
* Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
|
|
613
|
-
*/
|
|
614
|
-
'react-hooks/refs'?: Linter.RuleEntry<ReactHooksRefs>
|
|
615
|
-
/**
|
|
616
|
-
* Validates against suppression of other rules
|
|
617
|
-
*/
|
|
618
|
-
'react-hooks/rule-suppression'?: Linter.RuleEntry<ReactHooksRuleSuppression>
|
|
619
|
-
/**
|
|
620
|
-
* enforces the Rules of Hooks
|
|
621
|
-
* @see https://react.dev/reference/rules/rules-of-hooks
|
|
622
|
-
*/
|
|
623
|
-
'react-hooks/rules-of-hooks'?: Linter.RuleEntry<ReactHooksRulesOfHooks>
|
|
624
|
-
/**
|
|
625
|
-
* Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
|
|
626
|
-
*/
|
|
627
|
-
'react-hooks/set-state-in-effect'?: Linter.RuleEntry<ReactHooksSetStateInEffect>
|
|
628
|
-
/**
|
|
629
|
-
* Validates against setting state during render, which can trigger additional renders and potential infinite render loops
|
|
630
|
-
*/
|
|
631
|
-
'react-hooks/set-state-in-render'?: Linter.RuleEntry<ReactHooksSetStateInRender>
|
|
632
|
-
/**
|
|
633
|
-
* Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
|
|
634
|
-
*/
|
|
635
|
-
'react-hooks/static-components'?: Linter.RuleEntry<ReactHooksStaticComponents>
|
|
636
|
-
/**
|
|
637
|
-
* Validates against invalid syntax
|
|
638
|
-
*/
|
|
639
|
-
'react-hooks/syntax'?: Linter.RuleEntry<ReactHooksSyntax>
|
|
640
|
-
/**
|
|
641
|
-
* Unimplemented features
|
|
642
|
-
*/
|
|
643
|
-
'react-hooks/todo'?: Linter.RuleEntry<ReactHooksTodo>
|
|
644
|
-
/**
|
|
645
|
-
* Validates against syntax that we do not plan to support in React Compiler
|
|
646
|
-
*/
|
|
647
|
-
'react-hooks/unsupported-syntax'?: Linter.RuleEntry<ReactHooksUnsupportedSyntax>
|
|
648
|
-
/**
|
|
649
|
-
* Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
650
|
-
*/
|
|
651
|
-
'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>
|
|
652
|
-
/**
|
|
653
|
-
* Validates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
654
|
-
*/
|
|
655
|
-
'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>
|
|
656
533
|
/**
|
|
657
534
|
* Enforces naming conventions for components.
|
|
658
535
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-component-name
|
|
@@ -7785,125 +7662,6 @@ type ReactDomNoUnknownProperty = []|[{
|
|
|
7785
7662
|
ignore?: string[]
|
|
7786
7663
|
requireDataLowercase?: boolean
|
|
7787
7664
|
}]
|
|
7788
|
-
// ----- react-hooks/automatic-effect-dependencies -----
|
|
7789
|
-
type ReactHooksAutomaticEffectDependencies = []|[{
|
|
7790
|
-
[k: string]: unknown | undefined
|
|
7791
|
-
}]
|
|
7792
|
-
// ----- react-hooks/capitalized-calls -----
|
|
7793
|
-
type ReactHooksCapitalizedCalls = []|[{
|
|
7794
|
-
[k: string]: unknown | undefined
|
|
7795
|
-
}]
|
|
7796
|
-
// ----- react-hooks/component-hook-factories -----
|
|
7797
|
-
type ReactHooksComponentHookFactories = []|[{
|
|
7798
|
-
[k: string]: unknown | undefined
|
|
7799
|
-
}]
|
|
7800
|
-
// ----- react-hooks/config -----
|
|
7801
|
-
type ReactHooksConfig = []|[{
|
|
7802
|
-
[k: string]: unknown | undefined
|
|
7803
|
-
}]
|
|
7804
|
-
// ----- react-hooks/error-boundaries -----
|
|
7805
|
-
type ReactHooksErrorBoundaries = []|[{
|
|
7806
|
-
[k: string]: unknown | undefined
|
|
7807
|
-
}]
|
|
7808
|
-
// ----- react-hooks/exhaustive-deps -----
|
|
7809
|
-
type ReactHooksExhaustiveDeps = []|[{
|
|
7810
|
-
additionalHooks?: string
|
|
7811
|
-
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean
|
|
7812
|
-
experimental_autoDependenciesHooks?: string[]
|
|
7813
|
-
requireExplicitEffectDeps?: boolean
|
|
7814
|
-
}]
|
|
7815
|
-
// ----- react-hooks/fbt -----
|
|
7816
|
-
type ReactHooksFbt = []|[{
|
|
7817
|
-
[k: string]: unknown | undefined
|
|
7818
|
-
}]
|
|
7819
|
-
// ----- react-hooks/fire -----
|
|
7820
|
-
type ReactHooksFire = []|[{
|
|
7821
|
-
[k: string]: unknown | undefined
|
|
7822
|
-
}]
|
|
7823
|
-
// ----- react-hooks/gating -----
|
|
7824
|
-
type ReactHooksGating = []|[{
|
|
7825
|
-
[k: string]: unknown | undefined
|
|
7826
|
-
}]
|
|
7827
|
-
// ----- react-hooks/globals -----
|
|
7828
|
-
type ReactHooksGlobals = []|[{
|
|
7829
|
-
[k: string]: unknown | undefined
|
|
7830
|
-
}]
|
|
7831
|
-
// ----- react-hooks/hooks -----
|
|
7832
|
-
type ReactHooksHooks = []|[{
|
|
7833
|
-
[k: string]: unknown | undefined
|
|
7834
|
-
}]
|
|
7835
|
-
// ----- react-hooks/immutability -----
|
|
7836
|
-
type ReactHooksImmutability = []|[{
|
|
7837
|
-
[k: string]: unknown | undefined
|
|
7838
|
-
}]
|
|
7839
|
-
// ----- react-hooks/incompatible-library -----
|
|
7840
|
-
type ReactHooksIncompatibleLibrary = []|[{
|
|
7841
|
-
[k: string]: unknown | undefined
|
|
7842
|
-
}]
|
|
7843
|
-
// ----- react-hooks/invariant -----
|
|
7844
|
-
type ReactHooksInvariant = []|[{
|
|
7845
|
-
[k: string]: unknown | undefined
|
|
7846
|
-
}]
|
|
7847
|
-
// ----- react-hooks/memoized-effect-dependencies -----
|
|
7848
|
-
type ReactHooksMemoizedEffectDependencies = []|[{
|
|
7849
|
-
[k: string]: unknown | undefined
|
|
7850
|
-
}]
|
|
7851
|
-
// ----- react-hooks/no-deriving-state-in-effects -----
|
|
7852
|
-
type ReactHooksNoDerivingStateInEffects = []|[{
|
|
7853
|
-
[k: string]: unknown | undefined
|
|
7854
|
-
}]
|
|
7855
|
-
// ----- react-hooks/preserve-manual-memoization -----
|
|
7856
|
-
type ReactHooksPreserveManualMemoization = []|[{
|
|
7857
|
-
[k: string]: unknown | undefined
|
|
7858
|
-
}]
|
|
7859
|
-
// ----- react-hooks/purity -----
|
|
7860
|
-
type ReactHooksPurity = []|[{
|
|
7861
|
-
[k: string]: unknown | undefined
|
|
7862
|
-
}]
|
|
7863
|
-
// ----- react-hooks/refs -----
|
|
7864
|
-
type ReactHooksRefs = []|[{
|
|
7865
|
-
[k: string]: unknown | undefined
|
|
7866
|
-
}]
|
|
7867
|
-
// ----- react-hooks/rule-suppression -----
|
|
7868
|
-
type ReactHooksRuleSuppression = []|[{
|
|
7869
|
-
[k: string]: unknown | undefined
|
|
7870
|
-
}]
|
|
7871
|
-
// ----- react-hooks/rules-of-hooks -----
|
|
7872
|
-
type ReactHooksRulesOfHooks = []|[{
|
|
7873
|
-
additionalHooks?: string
|
|
7874
|
-
}]
|
|
7875
|
-
// ----- react-hooks/set-state-in-effect -----
|
|
7876
|
-
type ReactHooksSetStateInEffect = []|[{
|
|
7877
|
-
[k: string]: unknown | undefined
|
|
7878
|
-
}]
|
|
7879
|
-
// ----- react-hooks/set-state-in-render -----
|
|
7880
|
-
type ReactHooksSetStateInRender = []|[{
|
|
7881
|
-
[k: string]: unknown | undefined
|
|
7882
|
-
}]
|
|
7883
|
-
// ----- react-hooks/static-components -----
|
|
7884
|
-
type ReactHooksStaticComponents = []|[{
|
|
7885
|
-
[k: string]: unknown | undefined
|
|
7886
|
-
}]
|
|
7887
|
-
// ----- react-hooks/syntax -----
|
|
7888
|
-
type ReactHooksSyntax = []|[{
|
|
7889
|
-
[k: string]: unknown | undefined
|
|
7890
|
-
}]
|
|
7891
|
-
// ----- react-hooks/todo -----
|
|
7892
|
-
type ReactHooksTodo = []|[{
|
|
7893
|
-
[k: string]: unknown | undefined
|
|
7894
|
-
}]
|
|
7895
|
-
// ----- react-hooks/unsupported-syntax -----
|
|
7896
|
-
type ReactHooksUnsupportedSyntax = []|[{
|
|
7897
|
-
[k: string]: unknown | undefined
|
|
7898
|
-
}]
|
|
7899
|
-
// ----- react-hooks/use-memo -----
|
|
7900
|
-
type ReactHooksUseMemo = []|[{
|
|
7901
|
-
[k: string]: unknown | undefined
|
|
7902
|
-
}]
|
|
7903
|
-
// ----- react-hooks/void-use-memo -----
|
|
7904
|
-
type ReactHooksVoidUseMemo = []|[{
|
|
7905
|
-
[k: string]: unknown | undefined
|
|
7906
|
-
}]
|
|
7907
7665
|
// ----- react-naming-convention/component-name -----
|
|
7908
7666
|
type ReactNamingConventionComponentName = []|[(("PascalCase" | "CONSTANT_CASE") | {
|
|
7909
7667
|
allowAllCaps?: boolean
|
|
@@ -11692,7 +11450,7 @@ type VueValidVSlot = []|[{
|
|
|
11692
11450
|
allowModifiers?: boolean
|
|
11693
11451
|
}]
|
|
11694
11452
|
// Names of all the configs
|
|
11695
|
-
type ConfigNames = 'acaleph/javascript/setup' | 'acaleph/javascript/rules' | 'acaleph/typescript/setup' | 'acaleph/typescript/parser' | 'acaleph/typescript/rules' | 'acaleph/vue/setup' | 'acaleph/vue/rules' | 'acaleph/react/setup' | 'acaleph/react/rules' | 'acaleph/react/typescript' | '
|
|
11453
|
+
type ConfigNames = 'acaleph/javascript/setup' | 'acaleph/javascript/rules' | 'acaleph/typescript/setup' | 'acaleph/typescript/parser' | 'acaleph/typescript/rules' | 'acaleph/vue/setup' | 'acaleph/vue/rules' | 'acaleph/react/setup' | 'acaleph/react/rules' | 'acaleph/react/typescript' | 'acaleph/jsx/setup' | 'acaleph/stylistic/rules' | 'acaleph/imports/rules' | 'acaleph/perfectionist/setup' | 'acaleph/jsonc/setup' | 'acaleph/jsonc/rules'
|
|
11696
11454
|
|
|
11697
11455
|
/**
|
|
11698
11456
|
* Vendor types from Prettier so we don't rely on the dependency.
|
|
@@ -12074,7 +11832,6 @@ interface OptionsUnoCSS extends OptionsOverrides {
|
|
|
12074
11832
|
strict?: boolean;
|
|
12075
11833
|
}
|
|
12076
11834
|
interface OptionsReact extends OptionsOverrides {
|
|
12077
|
-
reactCompiler?: boolean;
|
|
12078
11835
|
}
|
|
12079
11836
|
interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
12080
11837
|
/**
|
package/dist/index.js
CHANGED
|
@@ -628,7 +628,7 @@ async function jsonc(options = {}) {
|
|
|
628
628
|
const pluginJsonc = await interopDefault(import("eslint-plugin-jsonc"));
|
|
629
629
|
return [
|
|
630
630
|
{
|
|
631
|
-
name: "
|
|
631
|
+
name: "acaleph/jsonc/setup",
|
|
632
632
|
plugins: {
|
|
633
633
|
jsonc: pluginJsonc
|
|
634
634
|
}
|
|
@@ -695,7 +695,7 @@ async function jsx(options = {}) {
|
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
697
|
},
|
|
698
|
-
name: "
|
|
698
|
+
name: "acaleph/jsx/setup",
|
|
699
699
|
plugins: {},
|
|
700
700
|
rules: {}
|
|
701
701
|
};
|
|
@@ -1049,21 +1049,16 @@ var ReactRouterPackages = [
|
|
|
1049
1049
|
var NextJsPackages = [
|
|
1050
1050
|
"next"
|
|
1051
1051
|
];
|
|
1052
|
-
var ReactCompilerPackages = [
|
|
1053
|
-
"babel-plugin-react-compiler"
|
|
1054
|
-
];
|
|
1055
1052
|
async function react(options = {}) {
|
|
1056
1053
|
const {
|
|
1057
1054
|
files = [GLOB_SRC],
|
|
1058
1055
|
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
1059
1056
|
ignoresTypeAware = [],
|
|
1060
1057
|
overrides = {},
|
|
1061
|
-
reactCompiler = ReactCompilerPackages.some((i) => isPackageExists2(i)),
|
|
1062
1058
|
tsconfigPath
|
|
1063
1059
|
} = options;
|
|
1064
1060
|
await ensurePackages([
|
|
1065
1061
|
"@eslint-react/eslint-plugin",
|
|
1066
|
-
"eslint-plugin-react-hooks",
|
|
1067
1062
|
"eslint-plugin-react-refresh"
|
|
1068
1063
|
]);
|
|
1069
1064
|
const isTypeAware = !!tsconfigPath;
|
|
@@ -1073,11 +1068,9 @@ async function react(options = {}) {
|
|
|
1073
1068
|
};
|
|
1074
1069
|
const [
|
|
1075
1070
|
pluginReact,
|
|
1076
|
-
pluginReactHooks,
|
|
1077
1071
|
pluginReactRefresh
|
|
1078
1072
|
] = await Promise.all([
|
|
1079
1073
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1080
|
-
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1081
1074
|
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1082
1075
|
]);
|
|
1083
1076
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists2(i));
|
|
@@ -1091,8 +1084,6 @@ async function react(options = {}) {
|
|
|
1091
1084
|
plugins: {
|
|
1092
1085
|
"react": plugins["@eslint-react"],
|
|
1093
1086
|
"react-dom": plugins["@eslint-react/dom"],
|
|
1094
|
-
"react-hooks": pluginReactHooks,
|
|
1095
|
-
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1096
1087
|
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1097
1088
|
"react-refresh": pluginReactRefresh,
|
|
1098
1089
|
"react-rsc": plugins["@eslint-react/rsc"],
|
|
@@ -1111,6 +1102,48 @@ async function react(options = {}) {
|
|
|
1111
1102
|
},
|
|
1112
1103
|
name: "acaleph/react/rules",
|
|
1113
1104
|
rules: {
|
|
1105
|
+
...pluginReact.configs.recommended.rules,
|
|
1106
|
+
"react-refresh/only-export-components": [
|
|
1107
|
+
"error",
|
|
1108
|
+
{
|
|
1109
|
+
allowConstantExport: isAllowConstantExport,
|
|
1110
|
+
allowExportNames: [
|
|
1111
|
+
...isUsingNext ? [
|
|
1112
|
+
// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
|
|
1113
|
+
"dynamic",
|
|
1114
|
+
"dynamicParams",
|
|
1115
|
+
"revalidate",
|
|
1116
|
+
"fetchCache",
|
|
1117
|
+
"runtime",
|
|
1118
|
+
"preferredRegion",
|
|
1119
|
+
"maxDuration",
|
|
1120
|
+
// https://nextjs.org/docs/app/api-reference/functions/generate-static-params
|
|
1121
|
+
"generateStaticParams",
|
|
1122
|
+
// https://nextjs.org/docs/app/api-reference/functions/generate-metadata
|
|
1123
|
+
"metadata",
|
|
1124
|
+
"generateMetadata",
|
|
1125
|
+
// https://nextjs.org/docs/app/api-reference/functions/generate-viewport
|
|
1126
|
+
"viewport",
|
|
1127
|
+
"generateViewport",
|
|
1128
|
+
// https://nextjs.org/docs/app/api-reference/functions/generate-image-metadata
|
|
1129
|
+
"generateImageMetadata",
|
|
1130
|
+
// https://nextjs.org/docs/app/api-reference/functions/generate-sitemaps
|
|
1131
|
+
"generateSitemaps"
|
|
1132
|
+
] : [],
|
|
1133
|
+
...isUsingRemix || isUsingReactRouter ? [
|
|
1134
|
+
"meta",
|
|
1135
|
+
"links",
|
|
1136
|
+
"headers",
|
|
1137
|
+
"loader",
|
|
1138
|
+
"action",
|
|
1139
|
+
"clientLoader",
|
|
1140
|
+
"clientAction",
|
|
1141
|
+
"handle",
|
|
1142
|
+
"shouldRevalidate"
|
|
1143
|
+
] : []
|
|
1144
|
+
]
|
|
1145
|
+
}
|
|
1146
|
+
],
|
|
1114
1147
|
// recommended rules from eslint-plugin-react-dom https://eslint-react.xyz/docs/rules/overview#dom-rules
|
|
1115
1148
|
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1116
1149
|
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
@@ -1124,18 +1157,10 @@ async function react(options = {}) {
|
|
|
1124
1157
|
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1125
1158
|
"react-dom/no-use-form-state": "error",
|
|
1126
1159
|
"react-dom/no-void-elements-with-children": "error",
|
|
1127
|
-
// recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
|
|
1128
|
-
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1129
|
-
"react-hooks/exhaustive-deps": "warn",
|
|
1130
|
-
// recommended rules eslint-plugin-react-hooks https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md
|
|
1131
|
-
// Core hooks rules
|
|
1132
|
-
"react-hooks/rules-of-hooks": "error",
|
|
1133
1160
|
// recommended rules from eslint-plugin-react-naming-convention https://eslint-react.xyz/docs/rules/overview#naming-convention-rules
|
|
1134
1161
|
"react-naming-convention/context-name": "warn",
|
|
1135
1162
|
"react-naming-convention/ref-name": "warn",
|
|
1136
1163
|
"react-naming-convention/use-state": "warn",
|
|
1137
|
-
// recommended rules from eslint-plugin-react-rsc https://eslint-react.xyz/docs/rules/overview#rsc-rules
|
|
1138
|
-
"react-rsc/function-definition": "error",
|
|
1139
1164
|
// recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
|
|
1140
1165
|
"react-web-api/no-leaked-event-listener": "warn",
|
|
1141
1166
|
"react-web-api/no-leaked-interval": "warn",
|
|
@@ -1181,66 +1206,6 @@ async function react(options = {}) {
|
|
|
1181
1206
|
"react/no-useless-forward-ref": "warn",
|
|
1182
1207
|
"react/prefer-namespace-import": "error",
|
|
1183
1208
|
"react/prefer-use-state-lazy-initialization": "warn",
|
|
1184
|
-
// React Compiler rules
|
|
1185
|
-
...reactCompiler ? {
|
|
1186
|
-
"react-hooks/component-hook-factories": "error",
|
|
1187
|
-
"react-hooks/config": "error",
|
|
1188
|
-
"react-hooks/error-boundaries": "error",
|
|
1189
|
-
"react-hooks/gating": "error",
|
|
1190
|
-
"react-hooks/globals": "error",
|
|
1191
|
-
"react-hooks/immutability": "error",
|
|
1192
|
-
"react-hooks/incompatible-library": "warn",
|
|
1193
|
-
"react-hooks/preserve-manual-memoization": "error",
|
|
1194
|
-
"react-hooks/purity": "error",
|
|
1195
|
-
"react-hooks/refs": "error",
|
|
1196
|
-
"react-hooks/set-state-in-effect": "error",
|
|
1197
|
-
"react-hooks/set-state-in-render": "error",
|
|
1198
|
-
"react-hooks/static-components": "error",
|
|
1199
|
-
"react-hooks/unsupported-syntax": "warn",
|
|
1200
|
-
"react-hooks/use-memo": "error"
|
|
1201
|
-
} : {},
|
|
1202
|
-
// preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
|
|
1203
|
-
"react-refresh/only-export-components": [
|
|
1204
|
-
"error",
|
|
1205
|
-
{
|
|
1206
|
-
allowConstantExport: isAllowConstantExport,
|
|
1207
|
-
allowExportNames: [
|
|
1208
|
-
...isUsingNext ? [
|
|
1209
|
-
// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
|
|
1210
|
-
"dynamic",
|
|
1211
|
-
"dynamicParams",
|
|
1212
|
-
"revalidate",
|
|
1213
|
-
"fetchCache",
|
|
1214
|
-
"runtime",
|
|
1215
|
-
"preferredRegion",
|
|
1216
|
-
"maxDuration",
|
|
1217
|
-
// https://nextjs.org/docs/app/api-reference/functions/generate-static-params
|
|
1218
|
-
"generateStaticParams",
|
|
1219
|
-
// https://nextjs.org/docs/app/api-reference/functions/generate-metadata
|
|
1220
|
-
"metadata",
|
|
1221
|
-
"generateMetadata",
|
|
1222
|
-
// https://nextjs.org/docs/app/api-reference/functions/generate-viewport
|
|
1223
|
-
"viewport",
|
|
1224
|
-
"generateViewport",
|
|
1225
|
-
// https://nextjs.org/docs/app/api-reference/functions/generate-image-metadata
|
|
1226
|
-
"generateImageMetadata",
|
|
1227
|
-
// https://nextjs.org/docs/app/api-reference/functions/generate-sitemaps
|
|
1228
|
-
"generateSitemaps"
|
|
1229
|
-
] : [],
|
|
1230
|
-
...isUsingRemix || isUsingReactRouter ? [
|
|
1231
|
-
"meta",
|
|
1232
|
-
"links",
|
|
1233
|
-
"headers",
|
|
1234
|
-
"loader",
|
|
1235
|
-
"action",
|
|
1236
|
-
"clientLoader",
|
|
1237
|
-
"clientAction",
|
|
1238
|
-
"handle",
|
|
1239
|
-
"shouldRevalidate"
|
|
1240
|
-
] : []
|
|
1241
|
-
]
|
|
1242
|
-
}
|
|
1243
|
-
],
|
|
1244
1209
|
...overrides
|
|
1245
1210
|
}
|
|
1246
1211
|
},
|
|
@@ -1260,7 +1225,7 @@ async function react(options = {}) {
|
|
|
1260
1225
|
...isTypeAware ? [{
|
|
1261
1226
|
files: filesTypeAware,
|
|
1262
1227
|
ignores: ignoresTypeAware,
|
|
1263
|
-
name: "
|
|
1228
|
+
name: "acaleph/react/type-aware-rules",
|
|
1264
1229
|
rules: {
|
|
1265
1230
|
...typeAwareRules
|
|
1266
1231
|
}
|
|
@@ -2276,14 +2241,14 @@ function acaleph(options = {}, ...userConfigs) {
|
|
|
2276
2241
|
if (typeof enableGitignore !== "boolean") {
|
|
2277
2242
|
configs2.push(
|
|
2278
2243
|
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
|
|
2279
|
-
name: "
|
|
2244
|
+
name: "acaleph/gitignore",
|
|
2280
2245
|
...enableGitignore
|
|
2281
2246
|
})])
|
|
2282
2247
|
);
|
|
2283
2248
|
} else {
|
|
2284
2249
|
configs2.push(
|
|
2285
2250
|
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
|
|
2286
|
-
name: "
|
|
2251
|
+
name: "acaleph/gitignore",
|
|
2287
2252
|
strict: false
|
|
2288
2253
|
})])
|
|
2289
2254
|
);
|
|
@@ -2438,7 +2403,7 @@ function acaleph(options = {}, ...userConfigs) {
|
|
|
2438
2403
|
disables()
|
|
2439
2404
|
);
|
|
2440
2405
|
if ("files" in options) {
|
|
2441
|
-
throw new Error('[
|
|
2406
|
+
throw new Error('[acaleph-eslint] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');
|
|
2442
2407
|
}
|
|
2443
2408
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
|
2444
2409
|
if (key in options) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acaleph-eslint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.5",
|
|
5
5
|
"packageManager": "pnpm@10.5.2",
|
|
6
6
|
"description": "",
|
|
7
7
|
"author": "acaleph",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"eslint": "^9.10.0 || ^10.0.0",
|
|
32
32
|
"eslint-plugin-format": ">=0.1.0",
|
|
33
33
|
"eslint-plugin-jsx-a11y": ">=6.10.2",
|
|
34
|
-
"eslint-plugin-react-hooks": "^7.0.0",
|
|
35
34
|
"eslint-plugin-react-refresh": "^0.5.0",
|
|
36
35
|
"eslint-plugin-vuejs-accessibility": "^2.4.1"
|
|
37
36
|
},
|
|
@@ -82,7 +81,6 @@
|
|
|
82
81
|
"eslint": "^9.10.0 || ^10.0.0",
|
|
83
82
|
"eslint-plugin-erasable-syntax-only": "^0.4.0",
|
|
84
83
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
85
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
86
84
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
87
85
|
"eslint-typegen": "^2.3.1",
|
|
88
86
|
"esno": "^4.8.0",
|