@antfu/eslint-config 7.1.0 → 7.3.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/cli.mjs +5 -5
- package/dist/index.d.mts +45 -23
- package/dist/index.mjs +28 -9
- package/dist/{lib-DDDPlqMl.mjs → lib-n9GhAGUi.mjs} +284 -260
- package/package.json +21 -21
package/dist/cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import parse from "parse-gitignore";
|
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "7.
|
|
12
|
+
var version = "7.3.0";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/cli/constants.ts
|
|
@@ -172,15 +172,15 @@ async function updateEslintFiles(result) {
|
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/cli/constants-generated.ts
|
|
174
174
|
const versionsMap = {
|
|
175
|
-
"@eslint-react/eslint-plugin": "^2.
|
|
176
|
-
"@next/eslint-plugin-next": "^16.1.
|
|
175
|
+
"@eslint-react/eslint-plugin": "^2.11.2",
|
|
176
|
+
"@next/eslint-plugin-next": "^16.1.6",
|
|
177
177
|
"@unocss/eslint-plugin": "^66.6.0",
|
|
178
178
|
"astro-eslint-parser": "^1.2.2",
|
|
179
179
|
"eslint": "^9.39.2",
|
|
180
180
|
"eslint-plugin-astro": "^1.5.0",
|
|
181
|
-
"eslint-plugin-format": "^1.
|
|
181
|
+
"eslint-plugin-format": "^1.4.0",
|
|
182
182
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
183
|
-
"eslint-plugin-react-refresh": "^0.
|
|
183
|
+
"eslint-plugin-react-refresh": "^0.5.0",
|
|
184
184
|
"eslint-plugin-solid": "^0.14.5",
|
|
185
185
|
"eslint-plugin-svelte": "^3.14.0",
|
|
186
186
|
"prettier-plugin-astro": "^0.14.1",
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
1
|
+
import { ConfigWithExtends, FlatConfigComposer } from "eslint-flat-config-utils";
|
|
2
2
|
import { Linter } from "eslint";
|
|
3
3
|
import { StylisticCustomizeOptions } from "@stylistic/eslint-plugin";
|
|
4
4
|
import { ParserOptions } from "@typescript-eslint/parser";
|
|
@@ -3257,7 +3257,7 @@ interface RuleOptions {
|
|
|
3257
3257
|
*/
|
|
3258
3258
|
'react-dom/no-unknown-property'?: Linter.RuleEntry<ReactDomNoUnknownProperty>;
|
|
3259
3259
|
/**
|
|
3260
|
-
* Enforces 'sandbox' attribute for 'iframe' elements is not set to unsafe combinations.
|
|
3260
|
+
* Enforces that the 'sandbox' attribute for 'iframe' elements is not set to unsafe combinations.
|
|
3261
3261
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
|
|
3262
3262
|
*/
|
|
3263
3263
|
'react-dom/no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]>;
|
|
@@ -3435,6 +3435,11 @@ interface RuleOptions {
|
|
|
3435
3435
|
*/
|
|
3436
3436
|
'react-naming-convention/use-state'?: Linter.RuleEntry<ReactNamingConventionUseState>;
|
|
3437
3437
|
'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
|
|
3438
|
+
/**
|
|
3439
|
+
* Validate and transform React Client/Server Function definitions.
|
|
3440
|
+
* @see https://eslint-react.xyz/docs/rules/function-definition
|
|
3441
|
+
*/
|
|
3442
|
+
'react-rsc/function-definition'?: Linter.RuleEntry<[]>;
|
|
3438
3443
|
/**
|
|
3439
3444
|
* Enforces that every 'addEventListener' in a component or custom hook has a corresponding 'removeEventListener'.
|
|
3440
3445
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
|
|
@@ -3456,12 +3461,12 @@ interface RuleOptions {
|
|
|
3456
3461
|
*/
|
|
3457
3462
|
'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>;
|
|
3458
3463
|
/**
|
|
3459
|
-
* Prevents unnecessary
|
|
3464
|
+
* Prevents unnecessary '$' symbols before JSX expressions.
|
|
3460
3465
|
* @see https://eslint-react.xyz/docs/rules/jsx-dollar
|
|
3461
3466
|
*/
|
|
3462
3467
|
'react/jsx-dollar'?: Linter.RuleEntry<[]>;
|
|
3463
3468
|
/**
|
|
3464
|
-
* Enforces
|
|
3469
|
+
* Enforces 'key' prop placement before spread props.
|
|
3465
3470
|
* @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread
|
|
3466
3471
|
*/
|
|
3467
3472
|
'react/jsx-key-before-spread'?: Linter.RuleEntry<[]>;
|
|
@@ -3476,7 +3481,7 @@ interface RuleOptions {
|
|
|
3476
3481
|
*/
|
|
3477
3482
|
'react/jsx-no-duplicate-props'?: Linter.RuleEntry<[]>;
|
|
3478
3483
|
/**
|
|
3479
|
-
* Disallows
|
|
3484
|
+
* Disallows immediately-invoked function expressions in JSX.
|
|
3480
3485
|
* @see https://eslint-react.xyz/docs/rules/jsx-no-iife
|
|
3481
3486
|
*/
|
|
3482
3487
|
'react/jsx-no-iife'?: Linter.RuleEntry<[]>;
|
|
@@ -3486,12 +3491,12 @@ interface RuleOptions {
|
|
|
3486
3491
|
*/
|
|
3487
3492
|
'react/jsx-no-undef'?: Linter.RuleEntry<[]>;
|
|
3488
3493
|
/**
|
|
3489
|
-
* Enforces
|
|
3494
|
+
* Enforces shorthand syntax for boolean props.
|
|
3490
3495
|
* @see https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean
|
|
3491
3496
|
*/
|
|
3492
3497
|
'react/jsx-shorthand-boolean'?: Linter.RuleEntry<ReactJsxShorthandBoolean>;
|
|
3493
3498
|
/**
|
|
3494
|
-
* Enforces
|
|
3499
|
+
* Enforces shorthand syntax for fragment elements.
|
|
3495
3500
|
* @see https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment
|
|
3496
3501
|
*/
|
|
3497
3502
|
'react/jsx-shorthand-fragment'?: Linter.RuleEntry<ReactJsxShorthandFragment>;
|
|
@@ -3501,7 +3506,7 @@ interface RuleOptions {
|
|
|
3501
3506
|
*/
|
|
3502
3507
|
'react/jsx-uses-react'?: Linter.RuleEntry<[]>;
|
|
3503
3508
|
/**
|
|
3504
|
-
* Marks
|
|
3509
|
+
* Marks JSX element variables as used.
|
|
3505
3510
|
* @see https://eslint-react.xyz/docs/rules/jsx-uses-vars
|
|
3506
3511
|
*/
|
|
3507
3512
|
'react/jsx-uses-vars'?: Linter.RuleEntry<[]>;
|
|
@@ -3607,7 +3612,7 @@ interface RuleOptions {
|
|
|
3607
3612
|
*/
|
|
3608
3613
|
'react/no-forward-ref'?: Linter.RuleEntry<[]>;
|
|
3609
3614
|
/**
|
|
3610
|
-
* Prevents
|
|
3615
|
+
* Prevents implicitly passing the 'key' prop to components.
|
|
3611
3616
|
* @see https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
3612
3617
|
*/
|
|
3613
3618
|
'react/no-implicit-key'?: Linter.RuleEntry<[]>;
|
|
@@ -3617,12 +3622,12 @@ interface RuleOptions {
|
|
|
3617
3622
|
*/
|
|
3618
3623
|
'react/no-leaked-conditional-rendering'?: Linter.RuleEntry<[]>;
|
|
3619
3624
|
/**
|
|
3620
|
-
* Enforces that all components have a 'displayName' that can be used in
|
|
3625
|
+
* Enforces that all components have a 'displayName' that can be used in DevTools.
|
|
3621
3626
|
* @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
3622
3627
|
*/
|
|
3623
3628
|
'react/no-missing-component-display-name'?: Linter.RuleEntry<[]>;
|
|
3624
3629
|
/**
|
|
3625
|
-
* Enforces that all contexts have a 'displayName' that can be used in
|
|
3630
|
+
* Enforces that all contexts have a 'displayName' that can be used in DevTools.
|
|
3626
3631
|
* @see https://eslint-react.xyz/docs/rules/no-missing-context-display-name
|
|
3627
3632
|
*/
|
|
3628
3633
|
'react/no-missing-context-display-name'?: Linter.RuleEntry<[]>;
|
|
@@ -3677,7 +3682,7 @@ interface RuleOptions {
|
|
|
3677
3682
|
*/
|
|
3678
3683
|
'react/no-string-refs'?: Linter.RuleEntry<[]>;
|
|
3679
3684
|
/**
|
|
3680
|
-
* Disallows unnecessary 'key' props on elements.
|
|
3685
|
+
* Disallows unnecessary 'key' props on nested child elements when rendering lists.
|
|
3681
3686
|
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
|
|
3682
3687
|
*/
|
|
3683
3688
|
'react/no-unnecessary-key'?: Linter.RuleEntry<[]>;
|
|
@@ -8796,6 +8801,7 @@ type AntfuConsistentListNewline = [] | [{
|
|
|
8796
8801
|
ExportNamedDeclaration?: boolean;
|
|
8797
8802
|
FunctionDeclaration?: boolean;
|
|
8798
8803
|
FunctionExpression?: boolean;
|
|
8804
|
+
IfStatement?: boolean;
|
|
8799
8805
|
ImportDeclaration?: boolean;
|
|
8800
8806
|
JSONArrayExpression?: boolean;
|
|
8801
8807
|
JSONObjectExpression?: boolean;
|
|
@@ -9181,7 +9187,7 @@ type FormatDprint = [] | [{
|
|
|
9181
9187
|
}];
|
|
9182
9188
|
// ----- format/prettier -----
|
|
9183
9189
|
type FormatPrettier = [] | [{
|
|
9184
|
-
parser
|
|
9190
|
+
parser: string;
|
|
9185
9191
|
[k: string]: unknown | undefined;
|
|
9186
9192
|
}];
|
|
9187
9193
|
// ----- func-call-spacing -----
|
|
@@ -9880,11 +9886,13 @@ type JsdocTypeFormatting = [] | [{
|
|
|
9880
9886
|
objectFieldSeparator?: ("comma" | "comma-and-linebreak" | "linebreak" | "semicolon" | "semicolon-and-linebreak");
|
|
9881
9887
|
objectFieldSeparatorOptionalLinebreak?: boolean;
|
|
9882
9888
|
objectFieldSeparatorTrailingPunctuation?: boolean;
|
|
9889
|
+
objectTypeBracketSpacing?: string;
|
|
9883
9890
|
parameterDefaultValueSpacing?: string;
|
|
9884
9891
|
postMethodNameSpacing?: string;
|
|
9885
9892
|
postNewSpacing?: string;
|
|
9886
9893
|
separatorForSingleObjectField?: boolean;
|
|
9887
9894
|
stringQuotes?: ("double" | "single");
|
|
9895
|
+
trailingPunctuationMultilineOnly?: boolean;
|
|
9888
9896
|
typeBracketSpacing?: string;
|
|
9889
9897
|
unionSpacing?: string;
|
|
9890
9898
|
}];
|
|
@@ -11724,7 +11732,7 @@ type PerfectionistSortArrayIncludes = {
|
|
|
11724
11732
|
pattern: string;
|
|
11725
11733
|
flags?: string;
|
|
11726
11734
|
} | string));
|
|
11727
|
-
selector?:
|
|
11735
|
+
selector?: "literal";
|
|
11728
11736
|
}, ...({
|
|
11729
11737
|
elementNamePattern?: (({
|
|
11730
11738
|
pattern: string;
|
|
@@ -11733,7 +11741,7 @@ type PerfectionistSortArrayIncludes = {
|
|
|
11733
11741
|
pattern: string;
|
|
11734
11742
|
flags?: string;
|
|
11735
11743
|
} | string));
|
|
11736
|
-
selector?:
|
|
11744
|
+
selector?: "literal";
|
|
11737
11745
|
})[]];
|
|
11738
11746
|
} | {
|
|
11739
11747
|
fallbackSort?: {
|
|
@@ -11751,7 +11759,7 @@ type PerfectionistSortArrayIncludes = {
|
|
|
11751
11759
|
pattern: string;
|
|
11752
11760
|
flags?: string;
|
|
11753
11761
|
} | string));
|
|
11754
|
-
selector?:
|
|
11762
|
+
selector?: "literal";
|
|
11755
11763
|
})[];
|
|
11756
11764
|
newlinesInside?: (("ignore" | number) | "newlinesBetween");
|
|
11757
11765
|
groups?: (string | [string, ...(string)[]] | {
|
|
@@ -11919,6 +11927,7 @@ type PerfectionistSortClasses = [] | [{
|
|
|
11919
11927
|
order?: ("asc" | "desc");
|
|
11920
11928
|
})[];
|
|
11921
11929
|
newlinesBetween?: ("ignore" | number);
|
|
11930
|
+
useExperimentalDependencyDetection?: boolean;
|
|
11922
11931
|
ignoreCallbackDependenciesPatterns?: (({
|
|
11923
11932
|
pattern: string;
|
|
11924
11933
|
flags?: string;
|
|
@@ -12141,6 +12150,7 @@ type PerfectionistSortEnums = [] | [{
|
|
|
12141
12150
|
})[];
|
|
12142
12151
|
newlinesBetween?: ("ignore" | number);
|
|
12143
12152
|
sortByValue?: ("always" | "ifNumericEnum" | "never");
|
|
12153
|
+
useExperimentalDependencyDetection?: boolean;
|
|
12144
12154
|
partitionByComment?: (boolean | (({
|
|
12145
12155
|
pattern: string;
|
|
12146
12156
|
flags?: string;
|
|
@@ -12638,6 +12648,7 @@ type PerfectionistSortImports = {
|
|
|
12638
12648
|
maxLineLength?: number;
|
|
12639
12649
|
sortSideEffects?: boolean;
|
|
12640
12650
|
environment?: ("node" | "bun");
|
|
12651
|
+
useExperimentalDependencyDetection?: boolean;
|
|
12641
12652
|
partitionByComment?: (boolean | (({
|
|
12642
12653
|
pattern: string;
|
|
12643
12654
|
flags?: string;
|
|
@@ -13238,6 +13249,7 @@ type PerfectionistSortModules = [] | [{
|
|
|
13238
13249
|
order?: ("asc" | "desc");
|
|
13239
13250
|
})[];
|
|
13240
13251
|
newlinesBetween?: ("ignore" | number);
|
|
13252
|
+
useExperimentalDependencyDetection?: boolean;
|
|
13241
13253
|
partitionByComment?: (boolean | (({
|
|
13242
13254
|
pattern: string;
|
|
13243
13255
|
flags?: string;
|
|
@@ -13626,6 +13638,7 @@ type PerfectionistSortObjects = {
|
|
|
13626
13638
|
fallbackSort?: {
|
|
13627
13639
|
type: ("alphabetical" | "natural" | "line-length" | "custom" | "unsorted" | "subgroup-order");
|
|
13628
13640
|
order?: ("asc" | "desc");
|
|
13641
|
+
sortBy?: ("name" | "value");
|
|
13629
13642
|
};
|
|
13630
13643
|
type?: ("alphabetical" | "natural" | "line-length" | "custom" | "unsorted" | "subgroup-order");
|
|
13631
13644
|
specialCharacters?: ("remove" | "trim" | "keep");
|
|
@@ -13633,15 +13646,18 @@ type PerfectionistSortObjects = {
|
|
|
13633
13646
|
alphabet?: string;
|
|
13634
13647
|
locales?: (string | string[]);
|
|
13635
13648
|
order?: ("asc" | "desc");
|
|
13649
|
+
sortBy?: ("name" | "value");
|
|
13636
13650
|
customGroups?: ({
|
|
13637
13651
|
fallbackSort?: {
|
|
13638
13652
|
type: ("alphabetical" | "natural" | "line-length" | "custom" | "unsorted" | "subgroup-order");
|
|
13639
13653
|
order?: ("asc" | "desc");
|
|
13654
|
+
sortBy?: ("name" | "value");
|
|
13640
13655
|
};
|
|
13641
13656
|
type?: ("alphabetical" | "natural" | "line-length" | "custom" | "unsorted" | "subgroup-order");
|
|
13642
13657
|
groupName: string;
|
|
13643
13658
|
newlinesInside?: ("ignore" | number);
|
|
13644
13659
|
order?: ("asc" | "desc");
|
|
13660
|
+
sortBy?: ("name" | "value");
|
|
13645
13661
|
anyOf: [{
|
|
13646
13662
|
elementNamePattern?: (({
|
|
13647
13663
|
pattern: string;
|
|
@@ -13681,11 +13697,13 @@ type PerfectionistSortObjects = {
|
|
|
13681
13697
|
fallbackSort?: {
|
|
13682
13698
|
type: ("alphabetical" | "natural" | "line-length" | "custom" | "unsorted" | "subgroup-order");
|
|
13683
13699
|
order?: ("asc" | "desc");
|
|
13700
|
+
sortBy?: ("name" | "value");
|
|
13684
13701
|
};
|
|
13685
13702
|
type?: ("alphabetical" | "natural" | "line-length" | "custom" | "unsorted" | "subgroup-order");
|
|
13686
13703
|
groupName: string;
|
|
13687
13704
|
newlinesInside?: ("ignore" | number);
|
|
13688
13705
|
order?: ("asc" | "desc");
|
|
13706
|
+
sortBy?: ("name" | "value");
|
|
13689
13707
|
elementNamePattern?: (({
|
|
13690
13708
|
pattern: string;
|
|
13691
13709
|
flags?: string;
|
|
@@ -13711,11 +13729,13 @@ type PerfectionistSortObjects = {
|
|
|
13711
13729
|
fallbackSort?: {
|
|
13712
13730
|
type: ("alphabetical" | "natural" | "line-length" | "custom" | "unsorted" | "subgroup-order");
|
|
13713
13731
|
order?: ("asc" | "desc");
|
|
13732
|
+
sortBy?: ("name" | "value");
|
|
13714
13733
|
};
|
|
13715
13734
|
commentAbove?: string;
|
|
13716
13735
|
type?: ("alphabetical" | "natural" | "line-length" | "custom" | "unsorted" | "subgroup-order");
|
|
13717
13736
|
newlinesInside?: ("ignore" | number);
|
|
13718
13737
|
order?: ("asc" | "desc");
|
|
13738
|
+
sortBy?: ("name" | "value");
|
|
13719
13739
|
})[];
|
|
13720
13740
|
newlinesBetween?: ("ignore" | number);
|
|
13721
13741
|
useConfigurationIf?: {
|
|
@@ -13757,6 +13777,7 @@ type PerfectionistSortObjects = {
|
|
|
13757
13777
|
} | string));
|
|
13758
13778
|
};
|
|
13759
13779
|
styledComponents?: boolean;
|
|
13780
|
+
useExperimentalDependencyDetection?: boolean;
|
|
13760
13781
|
partitionByComment?: (boolean | (({
|
|
13761
13782
|
pattern: string;
|
|
13762
13783
|
flags?: string;
|
|
@@ -13810,7 +13831,7 @@ type PerfectionistSortSets = {
|
|
|
13810
13831
|
pattern: string;
|
|
13811
13832
|
flags?: string;
|
|
13812
13833
|
} | string));
|
|
13813
|
-
selector?:
|
|
13834
|
+
selector?: "literal";
|
|
13814
13835
|
}, ...({
|
|
13815
13836
|
elementNamePattern?: (({
|
|
13816
13837
|
pattern: string;
|
|
@@ -13819,7 +13840,7 @@ type PerfectionistSortSets = {
|
|
|
13819
13840
|
pattern: string;
|
|
13820
13841
|
flags?: string;
|
|
13821
13842
|
} | string));
|
|
13822
|
-
selector?:
|
|
13843
|
+
selector?: "literal";
|
|
13823
13844
|
})[]];
|
|
13824
13845
|
} | {
|
|
13825
13846
|
fallbackSort?: {
|
|
@@ -13837,7 +13858,7 @@ type PerfectionistSortSets = {
|
|
|
13837
13858
|
pattern: string;
|
|
13838
13859
|
flags?: string;
|
|
13839
13860
|
} | string));
|
|
13840
|
-
selector?:
|
|
13861
|
+
selector?: "literal";
|
|
13841
13862
|
})[];
|
|
13842
13863
|
newlinesInside?: (("ignore" | number) | "newlinesBetween");
|
|
13843
13864
|
groups?: (string | [string, ...(string)[]] | {
|
|
@@ -14070,6 +14091,7 @@ type PerfectionistSortVariableDeclarations = [] | [{
|
|
|
14070
14091
|
order?: ("asc" | "desc");
|
|
14071
14092
|
})[];
|
|
14072
14093
|
newlinesBetween?: ("ignore" | number);
|
|
14094
|
+
useExperimentalDependencyDetection?: boolean;
|
|
14073
14095
|
partitionByComment?: (boolean | (({
|
|
14074
14096
|
pattern: string;
|
|
14075
14097
|
flags?: string;
|
|
@@ -14346,9 +14368,9 @@ type ReactNamingConventionUseState = [] | [{
|
|
|
14346
14368
|
}];
|
|
14347
14369
|
// ----- react-refresh/only-export-components -----
|
|
14348
14370
|
type ReactRefreshOnlyExportComponents = [] | [{
|
|
14371
|
+
extraHOCs?: string[];
|
|
14349
14372
|
allowExportNames?: string[];
|
|
14350
14373
|
allowConstantExport?: boolean;
|
|
14351
|
-
customHOCs?: string[];
|
|
14352
14374
|
checkJS?: boolean;
|
|
14353
14375
|
}];
|
|
14354
14376
|
// ----- react/jsx-shorthand-boolean -----
|
|
@@ -19036,7 +19058,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
19036
19058
|
onlyEquality?: boolean;
|
|
19037
19059
|
}];
|
|
19038
19060
|
// Names of all the configs
|
|
19039
|
-
type ConfigNames = 'antfu/gitignore' | 'antfu/ignores' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/eslint-comments/rules' | 'antfu/command/rules' | 'antfu/perfectionist/setup' | 'antfu/node/rules' | 'antfu/jsdoc/rules' | 'antfu/imports/rules' | 'antfu/unicorn/rules' | 'antfu/jsx/setup' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/type-aware-parser' | 'antfu/typescript/rules' | 'antfu/typescript/rules-type-aware' | 'antfu/typescript/erasable-syntax-only' | 'antfu/stylistic/rules' | 'antfu/regexp/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/react/type-aware-rules' | 'antfu/nextjs/setup' | 'antfu/nextjs/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/unocss' | 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/sort/package-json' | 'antfu/sort/tsconfig-json' | 'antfu/pnpm/package-json' | 'antfu/pnpm/pnpm-workspace-yaml' | 'antfu/pnpm/pnpm-workspace-yaml-sort' | 'antfu/yaml/setup' | 'antfu/yaml/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/disables' | 'antfu/formatter/setup' | 'antfu/formatter/css' | 'antfu/formatter/scss' | 'antfu/formatter/less' | 'antfu/formatter/html' | 'antfu/formatter/xml' | 'antfu/formatter/svg' | 'antfu/formatter/markdown' | 'antfu/formatter/astro' | 'antfu/formatter/astro/disables' | 'antfu/formatter/graphql' | 'antfu/disables/scripts' | 'antfu/disables/cli' | 'antfu/disables/bin' | 'antfu/disables/dts' | 'antfu/disables/cjs' | 'antfu/disables/config-files';
|
|
19061
|
+
type ConfigNames = 'antfu/gitignore' | 'antfu/ignores' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/eslint-comments/rules' | 'antfu/command/rules' | 'antfu/perfectionist/setup' | 'antfu/node/rules' | 'antfu/jsdoc/rules' | 'antfu/imports/rules' | 'antfu/unicorn/rules' | 'antfu/jsx/setup' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/type-aware-parser' | 'antfu/typescript/rules' | 'antfu/typescript/rules-type-aware' | 'antfu/typescript/erasable-syntax-only' | 'antfu/stylistic/rules' | 'antfu/regexp/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/react/typescript' | 'antfu/react/type-aware-rules' | 'antfu/nextjs/setup' | 'antfu/nextjs/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/unocss' | 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/sort/package-json' | 'antfu/sort/tsconfig-json' | 'antfu/pnpm/package-json' | 'antfu/pnpm/pnpm-workspace-yaml' | 'antfu/pnpm/pnpm-workspace-yaml-sort' | 'antfu/yaml/setup' | 'antfu/yaml/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/disables' | 'antfu/formatter/setup' | 'antfu/formatter/css' | 'antfu/formatter/scss' | 'antfu/formatter/less' | 'antfu/formatter/html' | 'antfu/formatter/xml' | 'antfu/formatter/svg' | 'antfu/formatter/markdown' | 'antfu/formatter/astro' | 'antfu/formatter/astro/disables' | 'antfu/formatter/graphql' | 'antfu/disables/scripts' | 'antfu/disables/cli' | 'antfu/disables/bin' | 'antfu/disables/dts' | 'antfu/disables/cjs' | 'antfu/disables/config-files';
|
|
19040
19062
|
//#endregion
|
|
19041
19063
|
//#region src/vender/prettier-types.d.ts
|
|
19042
19064
|
/**
|
|
@@ -19166,7 +19188,7 @@ type Rules = Record<string, Linter.RuleEntry<any> | undefined> & RuleOptions;
|
|
|
19166
19188
|
* for `rules` and relaxes type limitations for `plugins` and `rules`, because
|
|
19167
19189
|
* many plugins still lack proper type definitions.
|
|
19168
19190
|
*/
|
|
19169
|
-
type TypedFlatConfigItem = Omit<
|
|
19191
|
+
type TypedFlatConfigItem = Omit<ConfigWithExtends, 'plugins' | 'rules'> & {
|
|
19170
19192
|
/**
|
|
19171
19193
|
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
19172
19194
|
* When `files` is specified, these plugins are only available to the matching files.
|
|
@@ -19889,4 +19911,4 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
|
|
|
19889
19911
|
declare function isInEditorEnv(): boolean;
|
|
19890
19912
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
19891
19913
|
//#endregion
|
|
19892
|
-
export { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, antfu, antfu as default, astro, combine, command, comments, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
19914
|
+
export { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, type RuleOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, antfu, antfu as default, astro, combine, command, comments, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
package/dist/index.mjs
CHANGED
|
@@ -1292,7 +1292,10 @@ async function react(options = {}) {
|
|
|
1292
1292
|
"eslint-plugin-react-refresh"
|
|
1293
1293
|
]);
|
|
1294
1294
|
const isTypeAware = !!tsconfigPath;
|
|
1295
|
-
const typeAwareRules = {
|
|
1295
|
+
const typeAwareRules = {
|
|
1296
|
+
"react/no-leaked-conditional-rendering": "warn",
|
|
1297
|
+
"react/no-implicit-key": "error"
|
|
1298
|
+
};
|
|
1296
1299
|
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
|
|
1297
1300
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1298
1301
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
@@ -1313,6 +1316,7 @@ async function react(options = {}) {
|
|
|
1313
1316
|
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1314
1317
|
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1315
1318
|
"react-refresh": pluginReactRefresh,
|
|
1319
|
+
"react-rsc": plugins["@eslint-react/rsc"],
|
|
1316
1320
|
"react-web-api": plugins["@eslint-react/web-api"]
|
|
1317
1321
|
}
|
|
1318
1322
|
},
|
|
@@ -1344,9 +1348,7 @@ async function react(options = {}) {
|
|
|
1344
1348
|
"react/no-create-ref": "error",
|
|
1345
1349
|
"react/no-default-props": "error",
|
|
1346
1350
|
"react/no-direct-mutation-state": "error",
|
|
1347
|
-
"react/no-duplicate-key": "error",
|
|
1348
1351
|
"react/no-forward-ref": "warn",
|
|
1349
|
-
"react/no-implicit-key": "warn",
|
|
1350
1352
|
"react/no-missing-key": "error",
|
|
1351
1353
|
"react/no-nested-component-definitions": "error",
|
|
1352
1354
|
"react/no-nested-lazy-component-declarations": "error",
|
|
@@ -1360,10 +1362,12 @@ async function react(options = {}) {
|
|
|
1360
1362
|
"react/no-unsafe-component-will-mount": "warn",
|
|
1361
1363
|
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1362
1364
|
"react/no-unsafe-component-will-update": "warn",
|
|
1365
|
+
"react/no-unused-class-component-members": "warn",
|
|
1363
1366
|
"react/no-use-context": "warn",
|
|
1364
1367
|
"react/no-useless-forward-ref": "warn",
|
|
1365
1368
|
"react/prefer-use-state-lazy-initialization": "warn",
|
|
1366
1369
|
"react/prefer-namespace-import": "error",
|
|
1370
|
+
"react-rsc/function-definition": "error",
|
|
1367
1371
|
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1368
1372
|
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1369
1373
|
"react-dom/no-find-dom-node": "error",
|
|
@@ -1376,6 +1380,14 @@ async function react(options = {}) {
|
|
|
1376
1380
|
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1377
1381
|
"react-dom/no-use-form-state": "error",
|
|
1378
1382
|
"react-dom/no-void-elements-with-children": "error",
|
|
1383
|
+
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1384
|
+
"react-naming-convention/context-name": "warn",
|
|
1385
|
+
"react-naming-convention/ref-name": "warn",
|
|
1386
|
+
"react-naming-convention/use-state": "warn",
|
|
1387
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
1388
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
1389
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1390
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
1379
1391
|
"react-hooks/rules-of-hooks": "error",
|
|
1380
1392
|
"react-hooks/exhaustive-deps": "warn",
|
|
1381
1393
|
...reactCompiler ? {
|
|
@@ -1395,11 +1407,6 @@ async function react(options = {}) {
|
|
|
1395
1407
|
"react-hooks/use-memo": "error",
|
|
1396
1408
|
"react-hooks/incompatible-library": "warn"
|
|
1397
1409
|
} : {},
|
|
1398
|
-
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1399
|
-
"react-web-api/no-leaked-event-listener": "warn",
|
|
1400
|
-
"react-web-api/no-leaked-interval": "warn",
|
|
1401
|
-
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1402
|
-
"react-web-api/no-leaked-timeout": "warn",
|
|
1403
1410
|
"react-refresh/only-export-components": ["error", {
|
|
1404
1411
|
allowConstantExport: isAllowConstantExport,
|
|
1405
1412
|
allowExportNames: [...isUsingNext ? [
|
|
@@ -1432,6 +1439,18 @@ async function react(options = {}) {
|
|
|
1432
1439
|
...overrides
|
|
1433
1440
|
}
|
|
1434
1441
|
},
|
|
1442
|
+
{
|
|
1443
|
+
files: filesTypeAware,
|
|
1444
|
+
name: "antfu/react/typescript",
|
|
1445
|
+
rules: {
|
|
1446
|
+
"react-dom/no-string-style-prop": "off",
|
|
1447
|
+
"react-dom/no-unknown-property": "off",
|
|
1448
|
+
"react/jsx-no-duplicate-props": "off",
|
|
1449
|
+
"react/jsx-no-undef": "off",
|
|
1450
|
+
"react/jsx-uses-react": "off",
|
|
1451
|
+
"react/jsx-uses-vars": "off"
|
|
1452
|
+
}
|
|
1453
|
+
},
|
|
1435
1454
|
...isTypeAware ? [{
|
|
1436
1455
|
files: filesTypeAware,
|
|
1437
1456
|
ignores: ignoresTypeAware,
|
|
@@ -2031,7 +2050,7 @@ async function typescript(options = {}) {
|
|
|
2031
2050
|
}] : [],
|
|
2032
2051
|
...erasableOnly ? [{
|
|
2033
2052
|
name: "antfu/typescript/erasable-syntax-only",
|
|
2034
|
-
plugins: { "erasable-syntax-only": await interopDefault(import("./lib-
|
|
2053
|
+
plugins: { "erasable-syntax-only": await interopDefault(import("./lib-n9GhAGUi.mjs")) },
|
|
2035
2054
|
rules: {
|
|
2036
2055
|
"erasable-syntax-only/enums": "error",
|
|
2037
2056
|
"erasable-syntax-only/import-aliases": "error",
|