@oxlint/migrate 1.70.0 → 1.71.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/bin/oxlint-migrate.mjs +3 -3
- package/dist/src/index.d.mts +325 -53
- package/dist/src/index.mjs +1 -1
- package/dist/{src-Cuy3Jdkv.mjs → src-CLLHiI8g.mjs} +15 -6
- package/package.json +12 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as nurseryRules, i as buildUnsupportedRuleExplanations, n as preFixForJsPlugins, o as rules_exports, r as isOffValue, s as normalizeRuleToCanonical, t as main } from "../src-
|
|
2
|
+
import { a as nurseryRules, i as buildUnsupportedRuleExplanations, n as preFixForJsPlugins, o as rules_exports, r as isOffValue, s as normalizeRuleToCanonical, t as main } from "../src-CLLHiI8g.mjs";
|
|
3
3
|
import { program } from "commander";
|
|
4
4
|
import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -30,7 +30,7 @@ const loadESLintConfig = async (filePath) => {
|
|
|
30
30
|
};
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region package.json
|
|
33
|
-
var version = "1.
|
|
33
|
+
var version = "1.71.0";
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/walker/comments/replaceRuleDirectiveComment.ts
|
|
36
36
|
const allRulesSet = new Set(Object.values(rules_exports).flat());
|
|
@@ -265,7 +265,7 @@ const getAllProjectFiles = () => {
|
|
|
265
265
|
//#region src/reporter.ts
|
|
266
266
|
var DefaultReporter = class {
|
|
267
267
|
warnings = /* @__PURE__ */ new Set();
|
|
268
|
-
skippedRules = new Map([
|
|
268
|
+
skippedRules = /* @__PURE__ */ new Map([
|
|
269
269
|
["nursery", /* @__PURE__ */ new Set()],
|
|
270
270
|
["type-aware", /* @__PURE__ */ new Set()],
|
|
271
271
|
["not-implemented", /* @__PURE__ */ new Set()],
|
package/dist/src/index.d.mts
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* What to enforce for `/// <reference types="..." />` references.
|
|
6
6
|
*/
|
|
7
|
-
//#region node_modules/.pnpm/oxlint@1.
|
|
7
|
+
//#region node_modules/.pnpm/oxlint@1.71.0_oxlint-tsgolint@0.23.0/node_modules/oxlint/dist/index.d.ts
|
|
8
8
|
//#region src-js/package/config.generated.d.ts
|
|
9
9
|
type AllowWarnDeny = ("allow" | "off" | "warn" | "error" | "deny") | number;
|
|
10
|
-
type GlobalValue = "readonly" | "writable" | "off";
|
|
10
|
+
type GlobalValue = ("readonly" | "writable" | "off") | undefined;
|
|
11
11
|
type ExternalPluginEntry = string | {
|
|
12
12
|
/**
|
|
13
13
|
* Custom name/alias for the plugin.
|
|
@@ -52,6 +52,7 @@ type OptionsJsonEnum = CommentConfigJson | {
|
|
|
52
52
|
line?: CommentConfigJson;
|
|
53
53
|
};
|
|
54
54
|
type IgnoreClassWithImplements = "all" | "public-fields";
|
|
55
|
+
type ComplexityConfigEnum = number | ComplexityConfig;
|
|
55
56
|
type Variant = "classic" | "modified";
|
|
56
57
|
/**
|
|
57
58
|
* The enforcement type for the curly rule.
|
|
@@ -64,22 +65,44 @@ type CurlyType = "all" | "multi" | "multi-line" | "multi-or-nest";
|
|
|
64
65
|
type CurlyConsistent = "consistent";
|
|
65
66
|
type CompareType = "always" | "smart";
|
|
66
67
|
type NullType = "always" | "never" | "ignore";
|
|
67
|
-
type
|
|
68
|
+
type FuncNameMatchingMode = "always" | "never";
|
|
68
69
|
type FuncNamesConfigType = "always" | "as-needed" | "never";
|
|
69
70
|
type Style = "expression" | "declaration";
|
|
70
71
|
type NamedExports = "ignore" | "expression" | "declaration";
|
|
71
72
|
type PairOrder = "anyOrder" | "getBeforeSet" | "setBeforeGet";
|
|
72
73
|
type Mode = "prefer-top-level" | "prefer-inline";
|
|
74
|
+
/**
|
|
75
|
+
* Extension rule configuration; Copy to avoid extra indirection.
|
|
76
|
+
*/
|
|
77
|
+
type ExtensionRule = "always" | "never" | "ignorePackages";
|
|
78
|
+
type ImportExtensionsObject = ImportExtensionsConfig | {
|
|
79
|
+
[k: string]: ExtensionRule;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Action to take for path group overrides.
|
|
83
|
+
*
|
|
84
|
+
* Determines how import extensions are validated for matching bespoke import specifiers.
|
|
85
|
+
*/
|
|
86
|
+
type PathGroupAction = "enforce" | "ignore";
|
|
73
87
|
type AbsoluteFirst = "absolute-first" | "disable-absolute-first";
|
|
74
88
|
type MaxDependenciesConfigJson = number | MaxDependenciesConfig;
|
|
75
89
|
type Target = "single" | "any";
|
|
76
90
|
type TestCaseName = "it" | "test";
|
|
77
91
|
type JestFnType = "hook" | "describe" | "test" | "expect" | "jest" | "unknown";
|
|
92
|
+
type DummyRule = AllowWarnDeny | [AllowWarnDeny, ...unknown[]];
|
|
78
93
|
type SnapshotHintMode = "always" | "multi";
|
|
79
94
|
type AltTextElements = "img" | "object" | "area" | 'input[type="image"]';
|
|
95
|
+
type AnchorIsValidAspect = "noHref" | "invalidHref" | "preferButton";
|
|
80
96
|
type Assert = "htmlFor" | "nesting" | "both" | "either";
|
|
81
97
|
type DistractingElement = "marquee" | "blink";
|
|
98
|
+
type MaxClassesPerFileConfigEnum = number | MaxClassesPerFileConfig;
|
|
99
|
+
type MaxDepthConfigEnum = number | MaxDepth;
|
|
100
|
+
type MaxLinesConfigEnum = number | MaxLinesConfig;
|
|
101
|
+
type MaxLinesPerFunctionConfigEnum = number | MaxLinesPerFunctionConfig;
|
|
102
|
+
type MaxNestedCallbacksConfigEnum = number | MaxNestedCallbacks;
|
|
103
|
+
type MaxParamsConfigEnum = number | MaxParamsConfig;
|
|
82
104
|
type CountThis = "always" | "never" | "except-void";
|
|
105
|
+
type MaxStatementsConfigEnum = number | MaxStatementsConfig;
|
|
83
106
|
type NoCondAssignConfig = "except-parens" | "always";
|
|
84
107
|
type CheckLoopsConfig = boolean | CheckLoops;
|
|
85
108
|
type CheckLoops = "all" | "allExceptWhileTrue" | "none";
|
|
@@ -107,6 +130,10 @@ type NoUnusedVarsFixMode = "off" | "suggestion" | "fix" | "safe-fix";
|
|
|
107
130
|
type NoUseBeforeDefineConfigJson = Nofunc | NoUseBeforeDefineConfig;
|
|
108
131
|
type Nofunc = "nofunc";
|
|
109
132
|
type Location = "start" | "anywhere";
|
|
133
|
+
/**
|
|
134
|
+
* The rule takes a single option - an array of possible callback names - which may include object methods. The default callback names are `callback`, `cb`, `next`.
|
|
135
|
+
*/
|
|
136
|
+
type CallbackReturn = string[];
|
|
110
137
|
/**
|
|
111
138
|
* The rule takes a single string option: the name of the error parameter.
|
|
112
139
|
*
|
|
@@ -119,8 +146,10 @@ type Location = "start" | "anywhere";
|
|
|
119
146
|
* Default: `"err"`.
|
|
120
147
|
*/
|
|
121
148
|
type HandleCallbackErrConfig = string;
|
|
149
|
+
type NoMixedRequiresConfig = boolean | NoMixedRequiresOptions;
|
|
122
150
|
type ShorthandType = "always" | "methods" | "properties" | "consistent" | "consistent-as-needed" | "never";
|
|
123
151
|
type Destructuring = "any" | "all";
|
|
152
|
+
type PreferDestructuringOption = PreferDestructuringTargetOption | PreferDestructuringAssignmentConfig;
|
|
124
153
|
type TerminationMethod = string | string[];
|
|
125
154
|
type RadixType = "always" | "as-needed";
|
|
126
155
|
type NativeAllowList = AllKeyword | string[];
|
|
@@ -225,7 +254,7 @@ type ChecksVoidReturn = boolean | ChecksVoidReturnOptions;
|
|
|
225
254
|
* - A string - ban with custom message
|
|
226
255
|
* - An object with `message` and optional `fixWith` and `suggest`
|
|
227
256
|
*/
|
|
228
|
-
type BanConfigValue = True | string | {
|
|
257
|
+
type BanConfigValue = (True | string | {
|
|
229
258
|
/**
|
|
230
259
|
* Replacement type for automatic fixing. Applied directly with `--fix`.
|
|
231
260
|
*/
|
|
@@ -238,7 +267,7 @@ type BanConfigValue = True | string | {
|
|
|
238
267
|
* Suggested replacement types for manual review. Shown as editor suggestions.
|
|
239
268
|
*/
|
|
240
269
|
suggest?: string[];
|
|
241
|
-
};
|
|
270
|
+
}) | undefined;
|
|
242
271
|
type True = true;
|
|
243
272
|
/**
|
|
244
273
|
* Represents the different ways `allowConstantLoopConditions` can be specified in JSON.
|
|
@@ -263,7 +292,7 @@ type PathOption = "always" | "never";
|
|
|
263
292
|
type TypesOption = "always" | "never" | "prefer-import";
|
|
264
293
|
type BomOptionType = "always" | "never";
|
|
265
294
|
type NonZero = "greater-than" | "not-equal";
|
|
266
|
-
type ModuleStylesOverride = false | {
|
|
295
|
+
type ModuleStylesOverride = (false | {
|
|
267
296
|
/**
|
|
268
297
|
* Whether default imports or whole-module `require()` assignments are allowed for this module.
|
|
269
298
|
*
|
|
@@ -300,7 +329,7 @@ type ModuleStylesOverride = false | {
|
|
|
300
329
|
* ```
|
|
301
330
|
*/
|
|
302
331
|
unassigned?: boolean;
|
|
303
|
-
};
|
|
332
|
+
}) | undefined;
|
|
304
333
|
type NoInstanceofBuiltinsStrategy = "strict" | "loose";
|
|
305
334
|
type PreferTernaryOption = "always" | "only-single-line";
|
|
306
335
|
type RelativeUrlStyleConfig = "never" | "always";
|
|
@@ -316,23 +345,23 @@ type CaseType2 = "camelCase" | "snake_case";
|
|
|
316
345
|
type AllowYoda = "never" | "always";
|
|
317
346
|
type OxlintOverrides = OxlintOverride[];
|
|
318
347
|
type JestVersionSchema = number | string;
|
|
319
|
-
type TagNamePreference = string | {
|
|
348
|
+
type TagNamePreference = (string | {
|
|
320
349
|
message: string;
|
|
321
350
|
replacement: string;
|
|
322
|
-
[k: string]: unknown;
|
|
351
|
+
[k: string]: unknown | undefined;
|
|
323
352
|
} | {
|
|
324
353
|
message: string;
|
|
325
|
-
[k: string]: unknown;
|
|
326
|
-
} | boolean;
|
|
354
|
+
[k: string]: unknown | undefined;
|
|
355
|
+
} | boolean) | undefined;
|
|
327
356
|
type OneOrManyFor_String = string | string[];
|
|
328
357
|
type CustomComponent = string | {
|
|
329
358
|
attribute: string;
|
|
330
359
|
name: string;
|
|
331
|
-
[k: string]: unknown;
|
|
360
|
+
[k: string]: unknown | undefined;
|
|
332
361
|
} | {
|
|
333
362
|
attributes: string[];
|
|
334
363
|
name: string;
|
|
335
|
-
[k: string]: unknown;
|
|
364
|
+
[k: string]: unknown | undefined;
|
|
336
365
|
};
|
|
337
366
|
/**
|
|
338
367
|
* Oxlint Configuration File
|
|
@@ -642,7 +671,7 @@ interface RuleCategories {
|
|
|
642
671
|
* - worker - Web Workers globals.
|
|
643
672
|
*/
|
|
644
673
|
interface OxlintEnv {
|
|
645
|
-
[k: string]: boolean;
|
|
674
|
+
[k: string]: boolean | undefined;
|
|
646
675
|
}
|
|
647
676
|
/**
|
|
648
677
|
* Add or remove global variables.
|
|
@@ -670,7 +699,7 @@ interface OxlintEnv {
|
|
|
670
699
|
* `"writeable"` or `true` to represent `"writable"`.
|
|
671
700
|
*/
|
|
672
701
|
interface OxlintGlobals {
|
|
673
|
-
[k: string]: GlobalValue;
|
|
702
|
+
[k: string]: GlobalValue | undefined;
|
|
674
703
|
}
|
|
675
704
|
/**
|
|
676
705
|
* Options for the linter.
|
|
@@ -773,7 +802,7 @@ interface DummyRuleMap {
|
|
|
773
802
|
"block-scoped-var"?: RuleNoConfig;
|
|
774
803
|
"capitalized-comments"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever] | [AllowWarnDeny, AlwaysNever, OptionsJsonEnum];
|
|
775
804
|
"class-methods-use-this"?: RuleNoConfig | [AllowWarnDeny, ClassMethodsUseThisConfig];
|
|
776
|
-
complexity?: RuleNoConfig | [AllowWarnDeny,
|
|
805
|
+
complexity?: RuleNoConfig | [AllowWarnDeny, ComplexityConfigEnum];
|
|
777
806
|
"constructor-super"?: RuleNoConfig;
|
|
778
807
|
curly?: RuleNoConfig | [AllowWarnDeny, CurlyType] | [AllowWarnDeny, CurlyType, CurlyConsistent];
|
|
779
808
|
"default-case"?: RuleNoConfig | [AllowWarnDeny, DefaultCaseConfig];
|
|
@@ -781,7 +810,7 @@ interface DummyRuleMap {
|
|
|
781
810
|
"default-param-last"?: RuleNoConfig;
|
|
782
811
|
eqeqeq?: RuleNoConfig | [AllowWarnDeny, CompareType] | [AllowWarnDeny, CompareType, EqeqeqOptions];
|
|
783
812
|
"for-direction"?: RuleNoConfig;
|
|
784
|
-
"func-name-matching"?:
|
|
813
|
+
"func-name-matching"?: RuleNoConfig | ([AllowWarnDeny, FuncNameMatchingMode] | [AllowWarnDeny, FuncNameMatchingMode, FuncNameMatchingConfig] | [AllowWarnDeny, FuncNameMatchingMode] | [AllowWarnDeny, FuncNameMatchingConfig]);
|
|
785
814
|
"func-names"?: RuleNoConfig | [AllowWarnDeny, FuncNamesConfigType] | [AllowWarnDeny, FuncNamesConfigType, FuncNamesGeneratorsConfig];
|
|
786
815
|
"func-style"?: RuleNoConfig | [AllowWarnDeny, Style] | [AllowWarnDeny, Style, FuncStyleConfig];
|
|
787
816
|
"getter-return"?: RuleNoConfig | [AllowWarnDeny, GetterReturn];
|
|
@@ -793,7 +822,7 @@ interface DummyRuleMap {
|
|
|
793
822
|
"import/default"?: RuleNoConfig;
|
|
794
823
|
"import/export"?: RuleNoConfig;
|
|
795
824
|
"import/exports-last"?: RuleNoConfig;
|
|
796
|
-
"import/extensions"?:
|
|
825
|
+
"import/extensions"?: RuleNoConfig | ([AllowWarnDeny, ExtensionRule] | [AllowWarnDeny, ExtensionRule, ImportExtensionsObject] | [AllowWarnDeny, ExtensionRule] | [AllowWarnDeny, ImportExtensionsObject]);
|
|
797
826
|
"import/first"?: RuleNoConfig | [AllowWarnDeny, AbsoluteFirst];
|
|
798
827
|
"import/group-exports"?: RuleNoConfig;
|
|
799
828
|
"import/max-dependencies"?: RuleNoConfig | [AllowWarnDeny, MaxDependenciesConfigJson];
|
|
@@ -890,9 +919,9 @@ interface DummyRuleMap {
|
|
|
890
919
|
"jsdoc/implements-on-classes"?: RuleNoConfig;
|
|
891
920
|
"jsdoc/no-defaults"?: RuleNoConfig | [AllowWarnDeny, NoDefaultsConfig];
|
|
892
921
|
"jsdoc/require-param"?: DummyRule;
|
|
893
|
-
"jsdoc/require-param-description"?: RuleNoConfig;
|
|
922
|
+
"jsdoc/require-param-description"?: RuleNoConfig | [AllowWarnDeny, RequireParamDescriptionConfig];
|
|
894
923
|
"jsdoc/require-param-name"?: RuleNoConfig;
|
|
895
|
-
"jsdoc/require-param-type"?: RuleNoConfig;
|
|
924
|
+
"jsdoc/require-param-type"?: RuleNoConfig | [AllowWarnDeny, RequireParamTypeConfig];
|
|
896
925
|
"jsdoc/require-property"?: RuleNoConfig;
|
|
897
926
|
"jsdoc/require-property-description"?: RuleNoConfig;
|
|
898
927
|
"jsdoc/require-property-name"?: RuleNoConfig;
|
|
@@ -908,7 +937,7 @@ interface DummyRuleMap {
|
|
|
908
937
|
"jsx-a11y/alt-text"?: RuleNoConfig | [AllowWarnDeny, AltTextConfigSchema];
|
|
909
938
|
"jsx-a11y/anchor-ambiguous-text"?: RuleNoConfig | [AllowWarnDeny, AnchorAmbiguousTextConfig];
|
|
910
939
|
"jsx-a11y/anchor-has-content"?: RuleNoConfig;
|
|
911
|
-
"jsx-a11y/anchor-is-valid"?:
|
|
940
|
+
"jsx-a11y/anchor-is-valid"?: RuleNoConfig | [AllowWarnDeny, AnchorIsValidConfig];
|
|
912
941
|
"jsx-a11y/aria-activedescendant-has-tabindex"?: RuleNoConfig;
|
|
913
942
|
"jsx-a11y/aria-props"?: RuleNoConfig;
|
|
914
943
|
"jsx-a11y/aria-proptypes"?: RuleNoConfig;
|
|
@@ -931,7 +960,7 @@ interface DummyRuleMap {
|
|
|
931
960
|
"jsx-a11y/no-autofocus"?: RuleNoConfig | [AllowWarnDeny, NoAutofocus];
|
|
932
961
|
"jsx-a11y/no-distracting-elements"?: RuleNoConfig | [AllowWarnDeny, NoDistractingElementsConfig];
|
|
933
962
|
"jsx-a11y/no-interactive-element-to-noninteractive-role"?: RuleNoConfig | [AllowWarnDeny, NoInteractiveElementToNoninteractiveRoleConfig];
|
|
934
|
-
"jsx-a11y/no-noninteractive-element-interactions"?:
|
|
963
|
+
"jsx-a11y/no-noninteractive-element-interactions"?: RuleNoConfig | [AllowWarnDeny, NoNoninteractiveElementInteractionsConfig];
|
|
935
964
|
"jsx-a11y/no-noninteractive-element-to-interactive-role"?: RuleNoConfig | [AllowWarnDeny, NoNoninteractiveElementToInteractiveRoleConfig];
|
|
936
965
|
"jsx-a11y/no-noninteractive-tabindex"?: RuleNoConfig | [AllowWarnDeny, NoNoninteractiveTabindexConfig];
|
|
937
966
|
"jsx-a11y/no-redundant-roles"?: RuleNoConfig | [AllowWarnDeny, NoRedundantRolesConfig];
|
|
@@ -942,13 +971,13 @@ interface DummyRuleMap {
|
|
|
942
971
|
"jsx-a11y/scope"?: RuleNoConfig;
|
|
943
972
|
"jsx-a11y/tabindex-no-positive"?: RuleNoConfig;
|
|
944
973
|
"logical-assignment-operators"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever] | [AllowWarnDeny, AlwaysNever, LogicalAssignmentOperatorsConfig];
|
|
945
|
-
"max-classes-per-file"?: RuleNoConfig | [AllowWarnDeny,
|
|
946
|
-
"max-depth"?: RuleNoConfig | [AllowWarnDeny,
|
|
947
|
-
"max-lines"?: RuleNoConfig | [AllowWarnDeny,
|
|
948
|
-
"max-lines-per-function"?: RuleNoConfig | [AllowWarnDeny,
|
|
949
|
-
"max-nested-callbacks"?: RuleNoConfig | [AllowWarnDeny,
|
|
950
|
-
"max-params"?: RuleNoConfig | [AllowWarnDeny,
|
|
951
|
-
"max-statements"?: RuleNoConfig | [AllowWarnDeny,
|
|
974
|
+
"max-classes-per-file"?: RuleNoConfig | [AllowWarnDeny, MaxClassesPerFileConfigEnum];
|
|
975
|
+
"max-depth"?: RuleNoConfig | [AllowWarnDeny, MaxDepthConfigEnum];
|
|
976
|
+
"max-lines"?: RuleNoConfig | [AllowWarnDeny, MaxLinesConfigEnum];
|
|
977
|
+
"max-lines-per-function"?: RuleNoConfig | [AllowWarnDeny, MaxLinesPerFunctionConfigEnum];
|
|
978
|
+
"max-nested-callbacks"?: RuleNoConfig | [AllowWarnDeny, MaxNestedCallbacksConfigEnum];
|
|
979
|
+
"max-params"?: RuleNoConfig | [AllowWarnDeny, MaxParamsConfigEnum];
|
|
980
|
+
"max-statements"?: RuleNoConfig | [AllowWarnDeny, MaxStatementsConfigEnum];
|
|
952
981
|
"new-cap"?: RuleNoConfig | [AllowWarnDeny, NewCapConfig];
|
|
953
982
|
"nextjs/google-font-display"?: RuleNoConfig;
|
|
954
983
|
"nextjs/google-font-preconnect"?: RuleNoConfig;
|
|
@@ -1050,7 +1079,7 @@ interface DummyRuleMap {
|
|
|
1050
1079
|
"no-restricted-exports"?: RuleNoConfig | [AllowWarnDeny, NoRestrictedExportsConfig];
|
|
1051
1080
|
"no-restricted-globals"?: DummyRule;
|
|
1052
1081
|
"no-restricted-imports"?: DummyRule;
|
|
1053
|
-
"no-restricted-properties"?:
|
|
1082
|
+
"no-restricted-properties"?: RuleNoConfig | [AllowWarnDeny, PropertyDetails, ...PropertyDetails[]];
|
|
1054
1083
|
"no-return-assign"?: RuleNoConfig | [AllowWarnDeny, NoReturnAssignMode];
|
|
1055
1084
|
"no-script-url"?: RuleNoConfig;
|
|
1056
1085
|
"no-self-assign"?: RuleNoConfig | [AllowWarnDeny, NoSelfAssign];
|
|
@@ -1094,13 +1123,15 @@ interface DummyRuleMap {
|
|
|
1094
1123
|
"no-void"?: RuleNoConfig | [AllowWarnDeny, NoVoid];
|
|
1095
1124
|
"no-warning-comments"?: RuleNoConfig | [AllowWarnDeny, NoWarningCommentsConfigJson];
|
|
1096
1125
|
"no-with"?: RuleNoConfig;
|
|
1097
|
-
"node/callback-return"?:
|
|
1126
|
+
"node/callback-return"?: RuleNoConfig | [AllowWarnDeny, CallbackReturn];
|
|
1098
1127
|
"node/global-require"?: RuleNoConfig;
|
|
1099
1128
|
"node/handle-callback-err"?: RuleNoConfig | [AllowWarnDeny, HandleCallbackErrConfig];
|
|
1100
1129
|
"node/no-exports-assign"?: RuleNoConfig;
|
|
1130
|
+
"node/no-mixed-requires"?: RuleNoConfig | [AllowWarnDeny, NoMixedRequiresConfig];
|
|
1101
1131
|
"node/no-new-require"?: RuleNoConfig;
|
|
1102
1132
|
"node/no-path-concat"?: RuleNoConfig;
|
|
1103
1133
|
"node/no-process-env"?: RuleNoConfig | [AllowWarnDeny, NoProcessEnvConfig];
|
|
1134
|
+
"node/no-sync"?: RuleNoConfig | [AllowWarnDeny, NoSyncConfig];
|
|
1104
1135
|
"object-shorthand"?: RuleNoConfig | [AllowWarnDeny, ShorthandType] | [AllowWarnDeny, ShorthandType, ObjectShorthandOptions];
|
|
1105
1136
|
"operator-assignment"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever];
|
|
1106
1137
|
"oxc/approx-constant"?: RuleNoConfig;
|
|
@@ -1131,7 +1162,7 @@ interface DummyRuleMap {
|
|
|
1131
1162
|
"oxc/uninvoked-array-callback"?: RuleNoConfig;
|
|
1132
1163
|
"prefer-arrow-callback"?: RuleNoConfig | [AllowWarnDeny, PreferArrowCallbackConfig];
|
|
1133
1164
|
"prefer-const"?: RuleNoConfig | [AllowWarnDeny, PreferConstConfig];
|
|
1134
|
-
"prefer-destructuring"?:
|
|
1165
|
+
"prefer-destructuring"?: RuleNoConfig | [AllowWarnDeny, PreferDestructuringOption] | [AllowWarnDeny, PreferDestructuringOption, PreferDestructuringRenamedPropertiesConfig];
|
|
1135
1166
|
"prefer-exponentiation-operator"?: RuleNoConfig;
|
|
1136
1167
|
"prefer-named-capture-group"?: RuleNoConfig;
|
|
1137
1168
|
"prefer-numeric-literals"?: RuleNoConfig;
|
|
@@ -1185,7 +1216,7 @@ interface DummyRuleMap {
|
|
|
1185
1216
|
"react/jsx-no-constructed-context-values"?: RuleNoConfig;
|
|
1186
1217
|
"react/jsx-no-duplicate-props"?: RuleNoConfig;
|
|
1187
1218
|
"react/jsx-no-literals"?: RuleNoConfig | [AllowWarnDeny, JsxNoLiteralsConfig];
|
|
1188
|
-
"react/jsx-no-script-url"?:
|
|
1219
|
+
"react/jsx-no-script-url"?: RuleNoConfig | ([AllowWarnDeny, JsxNoScriptUrlComponent[]] | [AllowWarnDeny, JsxNoScriptUrlComponent[], JsxNoScriptUrlOptions] | [AllowWarnDeny, JsxNoScriptUrlOptions]);
|
|
1189
1220
|
"react/jsx-no-target-blank"?: RuleNoConfig | [AllowWarnDeny, JsxNoTargetBlank];
|
|
1190
1221
|
"react/jsx-no-undef"?: RuleNoConfig;
|
|
1191
1222
|
"react/jsx-no-useless-fragment"?: RuleNoConfig | [AllowWarnDeny, JsxNoUselessFragment];
|
|
@@ -1359,6 +1390,7 @@ interface DummyRuleMap {
|
|
|
1359
1390
|
"unicorn/explicit-length-check"?: RuleNoConfig | [AllowWarnDeny, ExplicitLengthCheck];
|
|
1360
1391
|
"unicorn/filename-case"?: DummyRule;
|
|
1361
1392
|
"unicorn/import-style"?: RuleNoConfig | [AllowWarnDeny, ImportStyleConfig];
|
|
1393
|
+
"unicorn/max-nested-calls"?: RuleNoConfig | [AllowWarnDeny, MaxNestedCalls];
|
|
1362
1394
|
"unicorn/new-for-builtins"?: RuleNoConfig;
|
|
1363
1395
|
"unicorn/no-abusive-eslint-disable"?: RuleNoConfig;
|
|
1364
1396
|
"unicorn/no-accessor-recursion"?: RuleNoConfig;
|
|
@@ -1414,7 +1446,7 @@ interface DummyRuleMap {
|
|
|
1414
1446
|
"unicorn/no-useless-undefined"?: RuleNoConfig | [AllowWarnDeny, NoUselessUndefined];
|
|
1415
1447
|
"unicorn/no-zero-fractions"?: RuleNoConfig;
|
|
1416
1448
|
"unicorn/number-literal-case"?: RuleNoConfig;
|
|
1417
|
-
"unicorn/numeric-separators-style"?:
|
|
1449
|
+
"unicorn/numeric-separators-style"?: RuleNoConfig | [AllowWarnDeny, NumericSeparatorsStyleConfig];
|
|
1418
1450
|
"unicorn/prefer-add-event-listener"?: RuleNoConfig;
|
|
1419
1451
|
"unicorn/prefer-array-find"?: RuleNoConfig;
|
|
1420
1452
|
"unicorn/prefer-array-flat"?: RuleNoConfig;
|
|
@@ -1448,6 +1480,7 @@ interface DummyRuleMap {
|
|
|
1448
1480
|
"unicorn/prefer-native-coercion-functions"?: RuleNoConfig;
|
|
1449
1481
|
"unicorn/prefer-negative-index"?: RuleNoConfig;
|
|
1450
1482
|
"unicorn/prefer-node-protocol"?: RuleNoConfig;
|
|
1483
|
+
"unicorn/prefer-number-coercion"?: RuleNoConfig;
|
|
1451
1484
|
"unicorn/prefer-number-properties"?: RuleNoConfig | [AllowWarnDeny, PreferNumberPropertiesConfig];
|
|
1452
1485
|
"unicorn/prefer-object-from-entries"?: RuleNoConfig | [AllowWarnDeny, PreferObjectFromEntriesConfig];
|
|
1453
1486
|
"unicorn/prefer-optional-catch-binding"?: RuleNoConfig;
|
|
@@ -1561,6 +1594,7 @@ interface DummyRuleMap {
|
|
|
1561
1594
|
"vue/max-props"?: RuleNoConfig | [AllowWarnDeny, MaxProps];
|
|
1562
1595
|
"vue/next-tick-style"?: RuleNoConfig | [AllowWarnDeny, NextTickOption];
|
|
1563
1596
|
"vue/no-arrow-functions-in-watch"?: RuleNoConfig;
|
|
1597
|
+
"vue/no-async-in-computed-properties"?: RuleNoConfig | [AllowWarnDeny, NoAsyncInComputedPropertiesConfig];
|
|
1564
1598
|
"vue/no-computed-properties-in-data"?: RuleNoConfig;
|
|
1565
1599
|
"vue/no-deprecated-data-object-declaration"?: RuleNoConfig;
|
|
1566
1600
|
"vue/no-deprecated-delete-set"?: RuleNoConfig;
|
|
@@ -1637,6 +1671,10 @@ interface ArrayCallbackReturn {
|
|
|
1637
1671
|
checkForEach?: boolean;
|
|
1638
1672
|
}
|
|
1639
1673
|
interface ArrowBodyStyleConfig {
|
|
1674
|
+
/**
|
|
1675
|
+
* Requires braces and an explicit return for object literals. This option only applies when
|
|
1676
|
+
* the first option is `"as-needed"`.
|
|
1677
|
+
*/
|
|
1640
1678
|
requireReturnForObjectLiteral?: boolean;
|
|
1641
1679
|
}
|
|
1642
1680
|
interface CommentConfigJson {
|
|
@@ -1716,6 +1754,16 @@ interface EqeqeqOptions {
|
|
|
1716
1754
|
*/
|
|
1717
1755
|
null?: NullType;
|
|
1718
1756
|
}
|
|
1757
|
+
interface FuncNameMatchingConfig {
|
|
1758
|
+
/**
|
|
1759
|
+
* If `considerPropertyDescriptor` is set to `true`, the check will take into account the use of `Object.create`, `Object.defineProperty`, `Object.defineProperties`, and `Reflect.defineProperty`.
|
|
1760
|
+
*/
|
|
1761
|
+
considerPropertyDescriptor?: boolean;
|
|
1762
|
+
/**
|
|
1763
|
+
* If `includeCommonJSModuleExports` is set to `true`, `module.exports` and `module["exports"]` will be checked by this rule.
|
|
1764
|
+
*/
|
|
1765
|
+
includeCommonJSModuleExports?: boolean;
|
|
1766
|
+
}
|
|
1719
1767
|
interface FuncNamesGeneratorsConfig {
|
|
1720
1768
|
/**
|
|
1721
1769
|
* Configuration for generator function expressions. If not specified, uses the
|
|
@@ -1848,6 +1896,36 @@ interface IdMatchOptions {
|
|
|
1848
1896
|
*/
|
|
1849
1897
|
properties?: boolean;
|
|
1850
1898
|
}
|
|
1899
|
+
interface ImportExtensionsConfig {
|
|
1900
|
+
/**
|
|
1901
|
+
* Whether to check type imports when enforcing extension rules.
|
|
1902
|
+
*/
|
|
1903
|
+
checkTypeImports?: boolean;
|
|
1904
|
+
/**
|
|
1905
|
+
* Whether to ignore package imports when enforcing extension rules.
|
|
1906
|
+
*/
|
|
1907
|
+
ignorePackages?: boolean;
|
|
1908
|
+
/**
|
|
1909
|
+
* Path group overrides for bespoke import specifiers.
|
|
1910
|
+
*/
|
|
1911
|
+
pathGroupOverrides?: PathGroupOverrideConfig[];
|
|
1912
|
+
/**
|
|
1913
|
+
* Per-extension rules.
|
|
1914
|
+
*/
|
|
1915
|
+
pattern?: {
|
|
1916
|
+
[k: string]: ExtensionRule;
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1919
|
+
interface PathGroupOverrideConfig {
|
|
1920
|
+
/**
|
|
1921
|
+
* Action to take when pattern matches.
|
|
1922
|
+
*/
|
|
1923
|
+
action: PathGroupAction;
|
|
1924
|
+
/**
|
|
1925
|
+
* Glob pattern to match import specifiers.
|
|
1926
|
+
*/
|
|
1927
|
+
pattern: string;
|
|
1928
|
+
}
|
|
1851
1929
|
interface MaxDependenciesConfig {
|
|
1852
1930
|
/**
|
|
1853
1931
|
* Whether to ignore type imports when counting dependencies.
|
|
@@ -2157,7 +2235,7 @@ interface NoLargeSnapshotsConfig {
|
|
|
2157
2235
|
* Snapshot names can be specified as regular expressions.
|
|
2158
2236
|
*/
|
|
2159
2237
|
allowedSnapshots?: {
|
|
2160
|
-
[k: string]: string[];
|
|
2238
|
+
[k: string]: string[] | undefined;
|
|
2161
2239
|
};
|
|
2162
2240
|
/**
|
|
2163
2241
|
* Maximum number of lines allowed for inline snapshots.
|
|
@@ -2169,10 +2247,10 @@ interface NoLargeSnapshotsConfig {
|
|
|
2169
2247
|
maxSize?: number;
|
|
2170
2248
|
}
|
|
2171
2249
|
interface NoRestrictedTestMethodsConfig {
|
|
2172
|
-
[k: string]: string | null;
|
|
2250
|
+
[k: string]: (string | null) | undefined;
|
|
2173
2251
|
}
|
|
2174
2252
|
interface NoRestrictedMatchersConfig {
|
|
2175
|
-
[k: string]: string | null;
|
|
2253
|
+
[k: string]: (string | null) | undefined;
|
|
2176
2254
|
}
|
|
2177
2255
|
interface NoStandaloneExpectConfig {
|
|
2178
2256
|
/**
|
|
@@ -2261,6 +2339,28 @@ interface NoDefaultsConfig {
|
|
|
2261
2339
|
*/
|
|
2262
2340
|
noOptionalParamNames?: boolean;
|
|
2263
2341
|
}
|
|
2342
|
+
interface RequireParamDescriptionConfig {
|
|
2343
|
+
/**
|
|
2344
|
+
* The description string to set by default for destructured roots. Defaults to "The root object".
|
|
2345
|
+
*/
|
|
2346
|
+
defaultDestructuredRootDescription?: string;
|
|
2347
|
+
/**
|
|
2348
|
+
* Whether to set a default destructured root description.
|
|
2349
|
+
* For example, you may wish to avoid manually having to set the description for a @param corresponding to a destructured root object as it should always be the same type of object.
|
|
2350
|
+
* Uses `defaultDestructuredRootDescription` for the description string. Defaults to `false`.
|
|
2351
|
+
*/
|
|
2352
|
+
setDefaultDestructuredRootDescription?: boolean;
|
|
2353
|
+
}
|
|
2354
|
+
interface RequireParamTypeConfig {
|
|
2355
|
+
/**
|
|
2356
|
+
* The type string to set by default for destructured roots. Defaults to "object".
|
|
2357
|
+
*/
|
|
2358
|
+
defaultDestructuredRootType?: string;
|
|
2359
|
+
/**
|
|
2360
|
+
* Whether to set a default destructured root type. For example, you may wish to avoid manually having to set the type for a `@param` corresponding to a destructured root object as it is always going to be an object. Uses `defaultDestructuredRootType` for the type string. Defaults to `false`.
|
|
2361
|
+
*/
|
|
2362
|
+
setDefaultDestructuredRootType?: boolean;
|
|
2363
|
+
}
|
|
2264
2364
|
interface RequireReturnsConfig {
|
|
2265
2365
|
/**
|
|
2266
2366
|
* Whether to check constructor methods.
|
|
@@ -2325,6 +2425,20 @@ interface AnchorAmbiguousTextConfig {
|
|
|
2325
2425
|
*/
|
|
2326
2426
|
words?: string[];
|
|
2327
2427
|
}
|
|
2428
|
+
interface AnchorIsValidConfig {
|
|
2429
|
+
/**
|
|
2430
|
+
* Sub-rule aspects to run.
|
|
2431
|
+
*/
|
|
2432
|
+
aspects?: AnchorIsValidAspect[];
|
|
2433
|
+
/**
|
|
2434
|
+
* Custom components to treat as anchor elements.
|
|
2435
|
+
*/
|
|
2436
|
+
components?: string[];
|
|
2437
|
+
/**
|
|
2438
|
+
* Custom prop names to treat as link destinations.
|
|
2439
|
+
*/
|
|
2440
|
+
specialLink?: string[];
|
|
2441
|
+
}
|
|
2328
2442
|
interface AriaRoleConfig {
|
|
2329
2443
|
/**
|
|
2330
2444
|
* Custom roles that should be allowed in addition to the ARIA spec.
|
|
@@ -2451,10 +2565,17 @@ interface NoDistractingElementsConfig {
|
|
|
2451
2565
|
elements?: DistractingElement[];
|
|
2452
2566
|
}
|
|
2453
2567
|
interface NoInteractiveElementToNoninteractiveRoleConfig {
|
|
2454
|
-
[k: string]: string[];
|
|
2568
|
+
[k: string]: string[] | undefined;
|
|
2569
|
+
}
|
|
2570
|
+
interface NoNoninteractiveElementInteractionsConfig {
|
|
2571
|
+
/**
|
|
2572
|
+
* An array of event handler names that should trigger this rule.
|
|
2573
|
+
*/
|
|
2574
|
+
handlers?: string[];
|
|
2575
|
+
[k: string]: string[] | undefined;
|
|
2455
2576
|
}
|
|
2456
2577
|
interface NoNoninteractiveElementToInteractiveRoleConfig {
|
|
2457
|
-
[k: string]: string[];
|
|
2578
|
+
[k: string]: string[] | undefined;
|
|
2458
2579
|
}
|
|
2459
2580
|
interface NoNoninteractiveTabindexConfig {
|
|
2460
2581
|
/**
|
|
@@ -2471,7 +2592,7 @@ interface NoNoninteractiveTabindexConfig {
|
|
|
2471
2592
|
tags?: string[];
|
|
2472
2593
|
}
|
|
2473
2594
|
interface NoRedundantRolesConfig {
|
|
2474
|
-
[k: string]: string[];
|
|
2595
|
+
[k: string]: string[] | undefined;
|
|
2475
2596
|
}
|
|
2476
2597
|
interface NoStaticElementInteractionsConfig {
|
|
2477
2598
|
/**
|
|
@@ -3184,6 +3305,31 @@ interface RestrictDefaultExports {
|
|
|
3184
3305
|
*/
|
|
3185
3306
|
namespaceFrom?: boolean;
|
|
3186
3307
|
}
|
|
3308
|
+
interface PropertyDetails {
|
|
3309
|
+
/**
|
|
3310
|
+
* Objects where property access should be allowed. This must be used with `property` and
|
|
3311
|
+
* cannot be used with `object`.
|
|
3312
|
+
*/
|
|
3313
|
+
allowObjects?: string[];
|
|
3314
|
+
/**
|
|
3315
|
+
* Properties where property access should be allowed. This must be used with `object` and
|
|
3316
|
+
* cannot be used with `property`.
|
|
3317
|
+
*/
|
|
3318
|
+
allowProperties?: string[];
|
|
3319
|
+
/**
|
|
3320
|
+
* A custom message to display.
|
|
3321
|
+
*/
|
|
3322
|
+
message?: string;
|
|
3323
|
+
/**
|
|
3324
|
+
* The object on which the property is being accessed.
|
|
3325
|
+
*/
|
|
3326
|
+
object?: string;
|
|
3327
|
+
/**
|
|
3328
|
+
* The property being accessed. If `object` is not specified, this applies to the named
|
|
3329
|
+
* property on all objects.
|
|
3330
|
+
*/
|
|
3331
|
+
property?: string;
|
|
3332
|
+
}
|
|
3187
3333
|
interface NoSelfAssign {
|
|
3188
3334
|
/**
|
|
3189
3335
|
* The `props` option when set to `false`, disables the checking of properties.
|
|
@@ -3677,12 +3823,26 @@ interface NoWarningCommentsConfigJson {
|
|
|
3677
3823
|
location?: Location;
|
|
3678
3824
|
terms?: string[];
|
|
3679
3825
|
}
|
|
3826
|
+
interface NoMixedRequiresOptions {
|
|
3827
|
+
allowCall?: boolean;
|
|
3828
|
+
grouping?: boolean;
|
|
3829
|
+
}
|
|
3680
3830
|
interface NoProcessEnvConfig {
|
|
3681
3831
|
/**
|
|
3682
3832
|
* Variable names which are allowed to be accessed on `process.env`.
|
|
3683
3833
|
*/
|
|
3684
3834
|
allowedVariables?: string[];
|
|
3685
3835
|
}
|
|
3836
|
+
interface NoSyncConfig {
|
|
3837
|
+
/**
|
|
3838
|
+
* Whether synchronous methods should be allowed at the top level of a file.
|
|
3839
|
+
*/
|
|
3840
|
+
allowAtRootLevel?: boolean;
|
|
3841
|
+
/**
|
|
3842
|
+
* Function names to ignore.
|
|
3843
|
+
*/
|
|
3844
|
+
ignores?: string[];
|
|
3845
|
+
}
|
|
3686
3846
|
interface ObjectShorthandOptions {
|
|
3687
3847
|
avoidExplicitReturnArrows?: boolean;
|
|
3688
3848
|
avoidQuotes?: boolean;
|
|
@@ -3777,6 +3937,17 @@ interface PreferConstConfig {
|
|
|
3777
3937
|
*/
|
|
3778
3938
|
ignoreReadBeforeAssign?: boolean;
|
|
3779
3939
|
}
|
|
3940
|
+
interface PreferDestructuringTargetOption {
|
|
3941
|
+
array?: boolean;
|
|
3942
|
+
object?: boolean;
|
|
3943
|
+
}
|
|
3944
|
+
interface PreferDestructuringAssignmentConfig {
|
|
3945
|
+
AssignmentExpression?: PreferDestructuringTargetOption;
|
|
3946
|
+
VariableDeclarator?: PreferDestructuringTargetOption;
|
|
3947
|
+
}
|
|
3948
|
+
interface PreferDestructuringRenamedPropertiesConfig {
|
|
3949
|
+
enforceForRenamedProperties?: boolean;
|
|
3950
|
+
}
|
|
3780
3951
|
interface PreferPromiseRejectErrors {
|
|
3781
3952
|
/**
|
|
3782
3953
|
* Whether to allow calls to `Promise.reject()` with no arguments.
|
|
@@ -4264,7 +4435,7 @@ interface JsxNoLiteralsConfig {
|
|
|
4264
4435
|
* An object where the keys are the element names and the values are objects with the same options as above. This allows you to specify different options for different elements.
|
|
4265
4436
|
*/
|
|
4266
4437
|
elementOverrides?: {
|
|
4267
|
-
[k: string]: ElementOverrideOptions;
|
|
4438
|
+
[k: string]: ElementOverrideOptions | undefined;
|
|
4268
4439
|
};
|
|
4269
4440
|
/**
|
|
4270
4441
|
* (default: false) - When true the rule ignores literals used in props, wrapped or unwrapped.
|
|
@@ -4316,6 +4487,22 @@ interface ElementOverrideOptions {
|
|
|
4316
4487
|
*/
|
|
4317
4488
|
restrictedAttributes?: string[];
|
|
4318
4489
|
}
|
|
4490
|
+
interface JsxNoScriptUrlComponent {
|
|
4491
|
+
/**
|
|
4492
|
+
* Component name.
|
|
4493
|
+
*/
|
|
4494
|
+
name: string;
|
|
4495
|
+
/**
|
|
4496
|
+
* List of properties that should be validated.
|
|
4497
|
+
*/
|
|
4498
|
+
props: string[];
|
|
4499
|
+
}
|
|
4500
|
+
interface JsxNoScriptUrlOptions {
|
|
4501
|
+
/**
|
|
4502
|
+
* Whether to include components from settings.
|
|
4503
|
+
*/
|
|
4504
|
+
includeFromSettings?: boolean;
|
|
4505
|
+
}
|
|
4319
4506
|
interface JsxNoTargetBlank {
|
|
4320
4507
|
/**
|
|
4321
4508
|
* Whether to allow referrers.
|
|
@@ -5171,7 +5358,7 @@ interface NoRestrictedTypesConfig {
|
|
|
5171
5358
|
* A mapping of type names to ban configurations.
|
|
5172
5359
|
*/
|
|
5173
5360
|
types?: {
|
|
5174
|
-
[k: string]: BanConfigValue;
|
|
5361
|
+
[k: string]: BanConfigValue | undefined;
|
|
5175
5362
|
};
|
|
5176
5363
|
}
|
|
5177
5364
|
interface NoThisAliasConfig {
|
|
@@ -5719,9 +5906,15 @@ interface ImportStyleConfig {
|
|
|
5719
5906
|
* ```
|
|
5720
5907
|
*/
|
|
5721
5908
|
styles?: {
|
|
5722
|
-
[k: string]: ModuleStylesOverride;
|
|
5909
|
+
[k: string]: ModuleStylesOverride | undefined;
|
|
5723
5910
|
};
|
|
5724
5911
|
}
|
|
5912
|
+
interface MaxNestedCalls {
|
|
5913
|
+
/**
|
|
5914
|
+
* The maximum allowed nested call depth.
|
|
5915
|
+
*/
|
|
5916
|
+
max?: number;
|
|
5917
|
+
}
|
|
5725
5918
|
interface NoArrayReduce {
|
|
5726
5919
|
/**
|
|
5727
5920
|
* When set to `true`, allows simple operations (like summing numbers) in `reduce` and `reduceRight` calls.
|
|
@@ -5806,6 +5999,77 @@ interface NoUselessUndefined {
|
|
|
5806
5999
|
*/
|
|
5807
6000
|
checkArrowFunctionBody?: boolean;
|
|
5808
6001
|
}
|
|
6002
|
+
interface NumericSeparatorsStyleConfig {
|
|
6003
|
+
/**
|
|
6004
|
+
* Configuration for binary literals (e.g. `0b1010_0001` and bigint variants).
|
|
6005
|
+
* Controls how digits are grouped and when separators are applied.
|
|
6006
|
+
*/
|
|
6007
|
+
binary?: NumericBaseConfig;
|
|
6008
|
+
/**
|
|
6009
|
+
* Configuration for hexadecimal literals (e.g. `0xAB_CD`, `0Xab_cd`, and bigint variants).
|
|
6010
|
+
* Controls how digits are grouped and when separators are applied.
|
|
6011
|
+
*/
|
|
6012
|
+
hexadecimal?: NumericBaseConfig;
|
|
6013
|
+
/**
|
|
6014
|
+
* Configuration for decimal numbers (integers, fraction parts, and exponents).
|
|
6015
|
+
* Controls how digits are grouped and when separators are applied.
|
|
6016
|
+
*/
|
|
6017
|
+
number?: NumericNumberConfig;
|
|
6018
|
+
/**
|
|
6019
|
+
* Configuration for octal literals (e.g. `0o1234_5670` and bigint variants).
|
|
6020
|
+
* Controls how digits are grouped and when separators are applied.
|
|
6021
|
+
*/
|
|
6022
|
+
octal?: NumericBaseConfig;
|
|
6023
|
+
/**
|
|
6024
|
+
* Only enforce the rule when the numeric literal already contains a separator (`_`).
|
|
6025
|
+
*
|
|
6026
|
+
* When `true`, numbers without separators are left as-is; when `false` (default),
|
|
6027
|
+
* grouping will be enforced for eligible numbers even if they don't include separators yet.
|
|
6028
|
+
*/
|
|
6029
|
+
onlyIfContainsSeparator?: boolean;
|
|
6030
|
+
}
|
|
6031
|
+
interface NumericBaseConfig {
|
|
6032
|
+
/**
|
|
6033
|
+
* The number of digits per group when inserting numeric separators.
|
|
6034
|
+
* For example, a `groupLength` of 3 formats `1234567` as `1_234_567`.
|
|
6035
|
+
*/
|
|
6036
|
+
groupLength?: number;
|
|
6037
|
+
/**
|
|
6038
|
+
* The minimum number of digits required before grouping is applied.
|
|
6039
|
+
* Values with fewer digits than this threshold will not be grouped.
|
|
6040
|
+
*/
|
|
6041
|
+
minimumDigits?: number;
|
|
6042
|
+
/**
|
|
6043
|
+
* Only enforce the rule when the numeric literal already contains a separator (`_`).
|
|
6044
|
+
*
|
|
6045
|
+
* When `true`, numbers without separators are left as-is; when `false` (default),
|
|
6046
|
+
* grouping will be enforced for eligible numbers even if they don't include separators yet.
|
|
6047
|
+
*/
|
|
6048
|
+
onlyIfContainsSeparator?: boolean;
|
|
6049
|
+
}
|
|
6050
|
+
interface NumericNumberConfig {
|
|
6051
|
+
/**
|
|
6052
|
+
* The size a group of digits in the fractional part (after the decimal point) should be.
|
|
6053
|
+
*/
|
|
6054
|
+
fractionGroupLength?: number;
|
|
6055
|
+
/**
|
|
6056
|
+
* The number of digits per group when inserting numeric separators.
|
|
6057
|
+
* For example, a `groupLength` of 3 formats `1234567` as `1_234_567`.
|
|
6058
|
+
*/
|
|
6059
|
+
groupLength?: number;
|
|
6060
|
+
/**
|
|
6061
|
+
* The minimum number of digits required before grouping is applied.
|
|
6062
|
+
* Values with fewer digits than this threshold will not be grouped.
|
|
6063
|
+
*/
|
|
6064
|
+
minimumDigits?: number;
|
|
6065
|
+
/**
|
|
6066
|
+
* Only enforce the rule when the numeric literal already contains a separator (`_`).
|
|
6067
|
+
*
|
|
6068
|
+
* When `true`, numbers without separators are left as-is; when `false` (default),
|
|
6069
|
+
* grouping will be enforced for eligible numbers even if they don't include separators yet.
|
|
6070
|
+
*/
|
|
6071
|
+
onlyIfContainsSeparator?: boolean;
|
|
6072
|
+
}
|
|
5809
6073
|
interface PreferAtConfig {
|
|
5810
6074
|
/**
|
|
5811
6075
|
* Check all index access, not just special patterns like `array.length - 1`.
|
|
@@ -5954,6 +6218,14 @@ interface MaxProps {
|
|
|
5954
6218
|
*/
|
|
5955
6219
|
maxProps?: number;
|
|
5956
6220
|
}
|
|
6221
|
+
interface NoAsyncInComputedPropertiesConfig {
|
|
6222
|
+
/**
|
|
6223
|
+
* Names of identifiers whose member-call chains (`.then` / `.catch` / `.finally`)
|
|
6224
|
+
* should be ignored. Useful for libraries like Zod where `.catch(default)` is
|
|
6225
|
+
* a builder API, not a Promise method.
|
|
6226
|
+
*/
|
|
6227
|
+
ignoredObjectNames?: string[];
|
|
6228
|
+
}
|
|
5957
6229
|
interface NoDeprecatedModelDefinitionConfig {
|
|
5958
6230
|
/**
|
|
5959
6231
|
* Allow `model: { prop: 'modelValue', event: 'update:modelValue' }` (or
|
|
@@ -6072,7 +6344,7 @@ interface OxlintPluginSettings {
|
|
|
6072
6344
|
next?: NextPluginSettings;
|
|
6073
6345
|
react?: ReactPluginSettings;
|
|
6074
6346
|
vitest?: VitestPluginSettings;
|
|
6075
|
-
[k: string]: unknown;
|
|
6347
|
+
[k: string]: unknown | undefined;
|
|
6076
6348
|
}
|
|
6077
6349
|
/**
|
|
6078
6350
|
* Configure Jest plugin rules.
|
|
@@ -6089,7 +6361,7 @@ interface JestPluginSettings {
|
|
|
6089
6361
|
* :::
|
|
6090
6362
|
*/
|
|
6091
6363
|
version?: JestVersionSchema;
|
|
6092
|
-
[k: string]: unknown;
|
|
6364
|
+
[k: string]: unknown | undefined;
|
|
6093
6365
|
}
|
|
6094
6366
|
interface JSDocPluginSettings {
|
|
6095
6367
|
/**
|
|
@@ -6121,9 +6393,9 @@ interface JSDocPluginSettings {
|
|
|
6121
6393
|
*/
|
|
6122
6394
|
overrideReplacesDocs?: boolean;
|
|
6123
6395
|
tagNamePreference?: {
|
|
6124
|
-
[k: string]: TagNamePreference;
|
|
6396
|
+
[k: string]: TagNamePreference | undefined;
|
|
6125
6397
|
};
|
|
6126
|
-
[k: string]: unknown;
|
|
6398
|
+
[k: string]: unknown | undefined;
|
|
6127
6399
|
}
|
|
6128
6400
|
/**
|
|
6129
6401
|
* Configure JSX A11y plugin rules.
|
|
@@ -6155,7 +6427,7 @@ interface JSXA11YPluginSettings {
|
|
|
6155
6427
|
* ```
|
|
6156
6428
|
*/
|
|
6157
6429
|
attributes?: {
|
|
6158
|
-
[k: string]: string[];
|
|
6430
|
+
[k: string]: string[] | undefined;
|
|
6159
6431
|
};
|
|
6160
6432
|
/**
|
|
6161
6433
|
* To have your custom components be checked as DOM elements, you can
|
|
@@ -6177,7 +6449,7 @@ interface JSXA11YPluginSettings {
|
|
|
6177
6449
|
* ```
|
|
6178
6450
|
*/
|
|
6179
6451
|
components?: {
|
|
6180
|
-
[k: string]: string;
|
|
6452
|
+
[k: string]: string | undefined;
|
|
6181
6453
|
};
|
|
6182
6454
|
/**
|
|
6183
6455
|
* An optional setting that define the prop your code uses to create polymorphic components.
|
|
@@ -6194,7 +6466,7 @@ interface JSXA11YPluginSettings {
|
|
|
6194
6466
|
* as a `Box`.
|
|
6195
6467
|
*/
|
|
6196
6468
|
polymorphicPropName?: string;
|
|
6197
|
-
[k: string]: unknown;
|
|
6469
|
+
[k: string]: unknown | undefined;
|
|
6198
6470
|
}
|
|
6199
6471
|
/**
|
|
6200
6472
|
* Configure Next.js plugin rules.
|
|
@@ -6219,7 +6491,7 @@ interface NextPluginSettings {
|
|
|
6219
6491
|
* ```
|
|
6220
6492
|
*/
|
|
6221
6493
|
rootDir?: OneOrManyFor_String;
|
|
6222
|
-
[k: string]: unknown;
|
|
6494
|
+
[k: string]: unknown | undefined;
|
|
6223
6495
|
}
|
|
6224
6496
|
/**
|
|
6225
6497
|
* Configure React plugin rules.
|
|
@@ -6306,7 +6578,7 @@ interface ReactPluginSettings {
|
|
|
6306
6578
|
* ```
|
|
6307
6579
|
*/
|
|
6308
6580
|
version?: string;
|
|
6309
|
-
[k: string]: unknown;
|
|
6581
|
+
[k: string]: unknown | undefined;
|
|
6310
6582
|
}
|
|
6311
6583
|
/**
|
|
6312
6584
|
* Configure Vitest plugin rules.
|
|
@@ -6321,7 +6593,7 @@ interface VitestPluginSettings {
|
|
|
6321
6593
|
* to accommodate TypeScript type checking scenarios.
|
|
6322
6594
|
*/
|
|
6323
6595
|
typecheck?: boolean;
|
|
6324
|
-
[k: string]: unknown;
|
|
6596
|
+
[k: string]: unknown | undefined;
|
|
6325
6597
|
} //#endregion
|
|
6326
6598
|
//#region src-js/package/config.d.ts
|
|
6327
6599
|
type Oxlintrc = Omit<Oxlintrc$1, "$schema" | "extends">;
|
package/dist/src/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as main } from "../src-
|
|
1
|
+
import { t as main } from "../src-CLLHiI8g.mjs";
|
|
2
2
|
export { main as default };
|
|
@@ -73,7 +73,10 @@ const removeGlobalsWithAreCoveredByEnv = (config) => {
|
|
|
73
73
|
};
|
|
74
74
|
const transformBoolGlobalToString = (config) => {
|
|
75
75
|
if (config.globals === void 0 || config.globals === null) return;
|
|
76
|
-
for (const [entry, value] of Object.entries(config.globals))
|
|
76
|
+
for (const [entry, value] of Object.entries(config.globals)) {
|
|
77
|
+
if (typeof value === "string") continue;
|
|
78
|
+
config.globals[entry] = value ? "writable" : "readonly";
|
|
79
|
+
}
|
|
77
80
|
};
|
|
78
81
|
const transformEslintGlobalAccessToOxlintGlobalValue = (global) => {
|
|
79
82
|
if (global === false || global === "readable" || global === "readonly") return "readonly";
|
|
@@ -231,7 +234,7 @@ const typescriptRulesExtendEslintRules = [
|
|
|
231
234
|
];
|
|
232
235
|
//#endregion
|
|
233
236
|
//#region src/jsPlugins.ts
|
|
234
|
-
const ignorePlugins = new Set([
|
|
237
|
+
const ignorePlugins = /* @__PURE__ */ new Set([
|
|
235
238
|
...Object.keys(rulesPrefixesForPlugins),
|
|
236
239
|
...Object.values(rulesPrefixesForPlugins),
|
|
237
240
|
"local"
|
|
@@ -516,6 +519,7 @@ const pedanticRules = [
|
|
|
516
519
|
"unicorn/prefer-math-min-max",
|
|
517
520
|
"unicorn/prefer-math-trunc",
|
|
518
521
|
"unicorn/prefer-native-coercion-functions",
|
|
522
|
+
"unicorn/prefer-number-coercion",
|
|
519
523
|
"unicorn/prefer-prototype-methods",
|
|
520
524
|
"unicorn/prefer-query-selector",
|
|
521
525
|
"unicorn/prefer-regexp-test",
|
|
@@ -648,6 +652,8 @@ const styleRules = [
|
|
|
648
652
|
"node/callback-return",
|
|
649
653
|
"node/global-require",
|
|
650
654
|
"node/no-exports-assign",
|
|
655
|
+
"node/no-mixed-requires",
|
|
656
|
+
"node/no-sync",
|
|
651
657
|
"promise/avoid-new",
|
|
652
658
|
"promise/no-nesting",
|
|
653
659
|
"promise/no-return-wrap",
|
|
@@ -701,6 +707,7 @@ const styleRules = [
|
|
|
701
707
|
"unicorn/empty-brace-spaces",
|
|
702
708
|
"unicorn/error-message",
|
|
703
709
|
"unicorn/filename-case",
|
|
710
|
+
"unicorn/max-nested-calls",
|
|
704
711
|
"unicorn/no-array-method-this-argument",
|
|
705
712
|
"unicorn/no-await-expression-member",
|
|
706
713
|
"unicorn/no-console-spaces",
|
|
@@ -1179,6 +1186,7 @@ const correctnessRules = [
|
|
|
1179
1186
|
"vitest/valid-title",
|
|
1180
1187
|
"vitest/warn-todo",
|
|
1181
1188
|
"vue/no-arrow-functions-in-watch",
|
|
1189
|
+
"vue/no-async-in-computed-properties",
|
|
1182
1190
|
"vue/no-computed-properties-in-data",
|
|
1183
1191
|
"vue/no-deprecated-data-object-declaration",
|
|
1184
1192
|
"vue/no-deprecated-delete-set",
|
|
@@ -1509,6 +1517,7 @@ var unsupportedRules = {
|
|
|
1509
1517
|
"eslint/yield-star-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1510
1518
|
"react/jsx-uses-vars": "Handled by `eslint/no-unused-vars`, which already evaluates whether vars are used in JSX.",
|
|
1511
1519
|
"unicorn/no-named-default": "Implemented via `import/no-named-default`.",
|
|
1520
|
+
"unicorn/no-double-comparison": "Use `oxc/double-comparisons` instead.",
|
|
1512
1521
|
"vue/no-lone-template": "Not currently possible, as it requires Vue template parsing.",
|
|
1513
1522
|
"vue/no-v-html": "Not currently possible, as it requires Vue template parsing.",
|
|
1514
1523
|
"vue/this-in-template": "Not currently possible, as it requires Vue template parsing.",
|
|
@@ -1708,7 +1717,7 @@ function buildUnsupportedRuleExplanations() {
|
|
|
1708
1717
|
//#region src/plugins_rules.ts
|
|
1709
1718
|
const allRules = Object.values(rules_exports).flat();
|
|
1710
1719
|
const unsupportedRuleExplanations = buildUnsupportedRuleExplanations();
|
|
1711
|
-
const oxfmtImportSortingRules = new Set(["sort-imports", "perfectionist/sort-imports"]);
|
|
1720
|
+
const oxfmtImportSortingRules = /* @__PURE__ */ new Set(["sort-imports", "perfectionist/sort-imports"]);
|
|
1712
1721
|
/**
|
|
1713
1722
|
* checks if value is validSet, or if validSet is an array, check if value is first value of it
|
|
1714
1723
|
*/
|
|
@@ -1753,7 +1762,7 @@ const normalizeSeverityValue = (value) => {
|
|
|
1753
1762
|
}
|
|
1754
1763
|
};
|
|
1755
1764
|
const equivalentRuleNames = (rule) => {
|
|
1756
|
-
const names = new Set([rule, normalizeRuleToCanonical(rule)]);
|
|
1765
|
+
const names = /* @__PURE__ */ new Set([rule, normalizeRuleToCanonical(rule)]);
|
|
1757
1766
|
if (rule.startsWith("@typescript-eslint/")) {
|
|
1758
1767
|
const eslintRule = rule.slice(19);
|
|
1759
1768
|
if (typescriptRulesExtendEslintRules.includes(eslintRule)) names.add(eslintRule);
|
|
@@ -1906,8 +1915,8 @@ const mergeOverrideProperties = (target, source) => {
|
|
|
1906
1915
|
...target.rules,
|
|
1907
1916
|
...source.rules
|
|
1908
1917
|
};
|
|
1909
|
-
if (source.plugins) target.plugins = [
|
|
1910
|
-
if (source.jsPlugins) target.jsPlugins = [
|
|
1918
|
+
if (source.plugins) target.plugins = [.../* @__PURE__ */ new Set([...target.plugins ?? [], ...source.plugins])];
|
|
1919
|
+
if (source.jsPlugins) target.jsPlugins = [.../* @__PURE__ */ new Set([...target.jsPlugins ?? [], ...source.jsPlugins])];
|
|
1911
1920
|
if (source.env) target.env = {
|
|
1912
1921
|
...target.env,
|
|
1913
1922
|
...source.env
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxlint/migrate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.71.0",
|
|
4
4
|
"description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
"manual-test": "pnpm build; chmod +x dist/bin/oxlint-migrate.mjs; npx ."
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"commander": "^
|
|
41
|
+
"commander": "^15.0.0",
|
|
42
42
|
"globals": "^17.0.0",
|
|
43
|
-
"oxc-parser": "^0.
|
|
43
|
+
"oxc-parser": "^0.137.0",
|
|
44
44
|
"tinyglobby": "^0.2.14"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@antfu/eslint-config": "^
|
|
47
|
+
"@antfu/eslint-config": "^9.0.0",
|
|
48
48
|
"@babel/eslint-plugin": "^7.27.1",
|
|
49
49
|
"@e18e/eslint-plugin": "^0.5.0",
|
|
50
|
-
"@eslint-react/eslint-plugin": "^
|
|
50
|
+
"@eslint-react/eslint-plugin": "^5.0.0",
|
|
51
51
|
"@eslint/js": "^10.0.0",
|
|
52
52
|
"@logux/eslint-config": "^57.0.0",
|
|
53
53
|
"@oxc-node/core": "^0.1.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"eslint-plugin-header": "^3.1.1",
|
|
67
67
|
"eslint-plugin-import": "^2.32.0",
|
|
68
68
|
"eslint-plugin-import-x": "^4.16.0",
|
|
69
|
-
"eslint-plugin-jsdoc": "^
|
|
69
|
+
"eslint-plugin-jsdoc": "^63.0.0",
|
|
70
70
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
71
71
|
"eslint-plugin-local": "^6.0.0",
|
|
72
72
|
"eslint-plugin-mocha": "^11.2.0",
|
|
@@ -76,15 +76,15 @@
|
|
|
76
76
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
77
77
|
"eslint-plugin-react-perf": "^3.3.3",
|
|
78
78
|
"eslint-plugin-react-refresh": "^0.5.0",
|
|
79
|
-
"eslint-plugin-react-web-api": "^
|
|
79
|
+
"eslint-plugin-react-web-api": "^5.0.0",
|
|
80
80
|
"eslint-plugin-regexp": "^3.0.0",
|
|
81
81
|
"eslint-plugin-tsdoc": "^0.5.0",
|
|
82
|
-
"eslint-plugin-unicorn": "^
|
|
82
|
+
"eslint-plugin-unicorn": "^65.0.0",
|
|
83
83
|
"husky": "^9.1.7",
|
|
84
|
-
"lint-staged": "^
|
|
84
|
+
"lint-staged": "^17.0.0",
|
|
85
85
|
"next": "^16.0.0",
|
|
86
|
-
"oxfmt": "^0.
|
|
87
|
-
"oxlint": "^1.
|
|
86
|
+
"oxfmt": "^0.55.0",
|
|
87
|
+
"oxlint": "^1.71.0",
|
|
88
88
|
"oxlint-tsgolint": "^0.23.0",
|
|
89
89
|
"tsdown": "^0.22.0",
|
|
90
90
|
"typescript": "^6.0.0",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"lint-staged": {
|
|
95
95
|
"*": "oxfmt --no-error-on-unmatched-pattern"
|
|
96
96
|
},
|
|
97
|
-
"packageManager": "pnpm@11.
|
|
97
|
+
"packageManager": "pnpm@11.8.0"
|
|
98
98
|
}
|