@oxlint/migrate 1.72.0 → 1.75.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/README.md +8 -0
- package/dist/bin/oxlint-migrate.mjs +4 -3
- package/dist/src/index.d.mts +140 -21
- package/dist/src/index.mjs +1 -1
- package/dist/{src-CLLHiI8g.mjs → src-V0W_ayvY.mjs} +72 -30
- package/package.json +16 -18
package/README.md
CHANGED
|
@@ -115,3 +115,11 @@ Depending on how this is implemented by the given config, these behaviors may no
|
|
|
115
115
|
The JS Plugins API supports almost all ESLint v9+ plugins for linting JS/TS/JSX/TSX files, but there are still some minor holes in support. See the [JS Plugins documentation](https://oxc.rs/docs/guide/usage/linter/js-plugins.html) for specifics.
|
|
116
116
|
|
|
117
117
|
For example, if you currently use `eslint-plugin-svelte`, only some of its rules will work via JS Plugin, as Oxlint does not yet fully support custom file formats like `.svelte`. This means that Oxlint will only be able to lint the script blocks in your `.svelte` files, and not the template blocks where many of the `eslint-plugin-svelte` rules apply.
|
|
118
|
+
|
|
119
|
+
# [Sponsored By](https://oxc.rs/sponsor)
|
|
120
|
+
|
|
121
|
+
<p align="center">
|
|
122
|
+
<a href="https://oxc.rs/sponsor">
|
|
123
|
+
<img src="https://raw.githubusercontent.com/oxc-project/sponsors/main/sponsors.svg" alt="Our sponsors" />
|
|
124
|
+
</a>
|
|
125
|
+
</p>
|
|
@@ -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-V0W_ayvY.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.75.0";
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/walker/comments/replaceRuleDirectiveComment.ts
|
|
36
36
|
const allRulesSet = new Set(Object.values(rules_exports).flat());
|
|
@@ -425,7 +425,8 @@ const stripJsoncFeatures = (text) => text.replace(/\/\/.*$/gm, "").replace(/\/\*
|
|
|
425
425
|
* type-aware linting.
|
|
426
426
|
*/
|
|
427
427
|
const warnIfTsconfigHasBaseUrl = (reporter) => {
|
|
428
|
-
const
|
|
428
|
+
const tsconfigPath = path.join(cwd, "tsconfig.json");
|
|
429
|
+
const content = getFileContent(tsconfigPath);
|
|
429
430
|
if (content === void 0) return;
|
|
430
431
|
try {
|
|
431
432
|
const tsconfig = JSON.parse(stripJsoncFeatures(content));
|
package/dist/src/index.d.mts
CHANGED
|
@@ -4,7 +4,13 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* What to enforce for `/// <reference types="..." />` references.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* What to enforce for `/// <reference path="..." />` references.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* What to enforce for `/// <reference types="..." />` references.
|
|
12
|
+
*/
|
|
13
|
+
//#region node_modules/.pnpm/oxlint@1.75.0_oxlint-tsgolint@0.24.0/node_modules/oxlint/dist/index.d.ts
|
|
8
14
|
//#region src-js/package/config.generated.d.ts
|
|
9
15
|
type AllowWarnDeny = ("allow" | "off" | "warn" | "error" | "deny") | number;
|
|
10
16
|
type GlobalValue = ("readonly" | "writable" | "off") | undefined;
|
|
@@ -70,7 +76,7 @@ type FuncNamesConfigType = "always" | "as-needed" | "never";
|
|
|
70
76
|
type Style = "expression" | "declaration";
|
|
71
77
|
type NamedExports = "ignore" | "expression" | "declaration";
|
|
72
78
|
type PairOrder = "anyOrder" | "getBeforeSet" | "setBeforeGet";
|
|
73
|
-
type Mode = "prefer-top-level" | "prefer-inline";
|
|
79
|
+
type Mode = "prefer-top-level" | "prefer-inline" | "prefer-top-level-if-only-type-imports";
|
|
74
80
|
/**
|
|
75
81
|
* Extension rule configuration; Copy to avoid extra indirection.
|
|
76
82
|
*/
|
|
@@ -115,6 +121,7 @@ type AllowKind = "functions" | "arrowFunctions" | "generatorFunctions" | "method
|
|
|
115
121
|
*/
|
|
116
122
|
type NoInnerDeclarationsConfig = "functions" | "both";
|
|
117
123
|
type BlockScopedFunctions = "allow" | "disallow";
|
|
124
|
+
type Namespaces = "allow" | "disallow";
|
|
118
125
|
type NoMagicNumbersNumber = number | string;
|
|
119
126
|
type NoRestrictedImportsConfigEnum = string | RestrictedPath | NoRestrictedImportsConfig;
|
|
120
127
|
type PossiblePaths = string | RestrictedPath;
|
|
@@ -124,6 +131,7 @@ type NoReturnAssignMode = "always" | "except-parens";
|
|
|
124
131
|
* Controls how hoisting is handled when checking for shadowing.
|
|
125
132
|
*/
|
|
126
133
|
type HoistOption = "all" | "functions" | "functions-and-types" | "never" | "types";
|
|
134
|
+
type LoopType = "WhileStatement" | "DoWhileStatement" | "ForStatement" | "ForInStatement" | "ForOfStatement";
|
|
127
135
|
type NoUnusedVarsConfig = VarsOption | NoUnusedVarsOptions;
|
|
128
136
|
type VarsOption = "all" | "local";
|
|
129
137
|
type ArgsOption = "after-used" | "all" | "none";
|
|
@@ -179,6 +187,10 @@ type ForbidItem2 = string | {
|
|
|
179
187
|
*/
|
|
180
188
|
message?: string;
|
|
181
189
|
};
|
|
190
|
+
type NamedComponents = NamedComponentStyle | NamedComponentStyle[];
|
|
191
|
+
type NamedComponentStyle = "function-declaration" | "arrow-function" | "function-expression";
|
|
192
|
+
type UnnamedComponents = UnnamedComponentStyle | UnnamedComponentStyle[];
|
|
193
|
+
type UnnamedComponentStyle = "arrow-function" | "function-expression";
|
|
182
194
|
type EnforceBooleanAttribute = "always" | "never";
|
|
183
195
|
type JsxCurlyBracePresenceConfig = JsxCurlyBracePresenceMode | JsxCurlyBracePresence;
|
|
184
196
|
type JsxCurlyBracePresenceMode = "always" | "never" | "ignore";
|
|
@@ -296,6 +308,7 @@ type PathOption = "always" | "never";
|
|
|
296
308
|
type TypesOption = "always" | "never" | "prefer-import";
|
|
297
309
|
type BomOptionType = "always" | "never";
|
|
298
310
|
type NonZero = "greater-than" | "not-equal";
|
|
311
|
+
type ExplicitTimerDelayMode = "always" | "never";
|
|
299
312
|
type ModuleStylesOverride = (false | {
|
|
300
313
|
/**
|
|
301
314
|
* Whether default imports or whole-module `require()` assignments are allowed for this module.
|
|
@@ -481,7 +494,10 @@ interface Oxlintrc$1 {
|
|
|
481
494
|
*/
|
|
482
495
|
globals?: OxlintGlobals;
|
|
483
496
|
/**
|
|
484
|
-
* Globs to ignore during linting.
|
|
497
|
+
* Globs to ignore during linting. Patterns use gitignore-style matching,
|
|
498
|
+
* rooted at the directory containing the configuration file.
|
|
499
|
+
* Files outside that directory cannot be matched; patterns containing `..`
|
|
500
|
+
* are rejected as a configuration error.
|
|
485
501
|
*/
|
|
486
502
|
ignorePatterns?: string[];
|
|
487
503
|
/**
|
|
@@ -922,7 +938,7 @@ interface DummyRuleMap {
|
|
|
922
938
|
"jsdoc/empty-tags"?: RuleNoConfig | [AllowWarnDeny, EmptyTagsConfig];
|
|
923
939
|
"jsdoc/implements-on-classes"?: RuleNoConfig;
|
|
924
940
|
"jsdoc/no-defaults"?: RuleNoConfig | [AllowWarnDeny, NoDefaultsConfig];
|
|
925
|
-
"jsdoc/require-param"?:
|
|
941
|
+
"jsdoc/require-param"?: RuleNoConfig | [AllowWarnDeny, RequireParamConfig];
|
|
926
942
|
"jsdoc/require-param-description"?: RuleNoConfig | [AllowWarnDeny, RequireParamDescriptionConfig];
|
|
927
943
|
"jsdoc/require-param-name"?: RuleNoConfig;
|
|
928
944
|
"jsdoc/require-param-type"?: RuleNoConfig | [AllowWarnDeny, RequireParamTypeConfig];
|
|
@@ -1016,7 +1032,7 @@ interface DummyRuleMap {
|
|
|
1016
1032
|
"no-cond-assign"?: RuleNoConfig | [AllowWarnDeny, NoCondAssignConfig];
|
|
1017
1033
|
"no-console"?: RuleNoConfig | [AllowWarnDeny, NoConsoleConfig];
|
|
1018
1034
|
"no-const-assign"?: RuleNoConfig;
|
|
1019
|
-
"no-constant-binary-expression"?: RuleNoConfig;
|
|
1035
|
+
"no-constant-binary-expression"?: RuleNoConfig | [AllowWarnDeny, NoConstantBinaryExpressionConfig];
|
|
1020
1036
|
"no-constant-condition"?: RuleNoConfig | [AllowWarnDeny, NoConstantCondition];
|
|
1021
1037
|
"no-constructor-return"?: RuleNoConfig;
|
|
1022
1038
|
"no-continue"?: RuleNoConfig;
|
|
@@ -1105,6 +1121,7 @@ interface DummyRuleMap {
|
|
|
1105
1121
|
"no-unmodified-loop-condition"?: RuleNoConfig;
|
|
1106
1122
|
"no-unneeded-ternary"?: RuleNoConfig | [AllowWarnDeny, NoUnneededTernary];
|
|
1107
1123
|
"no-unreachable"?: RuleNoConfig;
|
|
1124
|
+
"no-unreachable-loop"?: RuleNoConfig | [AllowWarnDeny, NoUnreachableLoopConfig];
|
|
1108
1125
|
"no-unsafe-finally"?: RuleNoConfig;
|
|
1109
1126
|
"no-unsafe-negation"?: RuleNoConfig | [AllowWarnDeny, NoUnsafeNegation];
|
|
1110
1127
|
"no-unsafe-optional-chaining"?: RuleNoConfig | [AllowWarnDeny, NoUnsafeOptionalChaining];
|
|
@@ -1136,6 +1153,7 @@ interface DummyRuleMap {
|
|
|
1136
1153
|
"node/no-path-concat"?: RuleNoConfig;
|
|
1137
1154
|
"node/no-process-env"?: RuleNoConfig | [AllowWarnDeny, NoProcessEnvConfig];
|
|
1138
1155
|
"node/no-sync"?: RuleNoConfig | [AllowWarnDeny, NoSyncConfig];
|
|
1156
|
+
"node/no-top-level-await"?: RuleNoConfig | [AllowWarnDeny, NoTopLevelAwaitConfig];
|
|
1139
1157
|
"object-shorthand"?: RuleNoConfig | [AllowWarnDeny, ShorthandType] | [AllowWarnDeny, ShorthandType, ObjectShorthandOptions];
|
|
1140
1158
|
"operator-assignment"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever];
|
|
1141
1159
|
"oxc/approx-constant"?: RuleNoConfig;
|
|
@@ -1166,7 +1184,7 @@ interface DummyRuleMap {
|
|
|
1166
1184
|
"oxc/uninvoked-array-callback"?: RuleNoConfig;
|
|
1167
1185
|
"prefer-arrow-callback"?: RuleNoConfig | [AllowWarnDeny, PreferArrowCallbackConfig];
|
|
1168
1186
|
"prefer-const"?: RuleNoConfig | [AllowWarnDeny, PreferConstConfig];
|
|
1169
|
-
"prefer-destructuring"?: RuleNoConfig | [AllowWarnDeny, PreferDestructuringOption] | [AllowWarnDeny, PreferDestructuringOption,
|
|
1187
|
+
"prefer-destructuring"?: RuleNoConfig | [AllowWarnDeny, PreferDestructuringOption] | [AllowWarnDeny, PreferDestructuringOption, PreferDestructuringEnforcementConfig];
|
|
1170
1188
|
"prefer-exponentiation-operator"?: RuleNoConfig;
|
|
1171
1189
|
"prefer-named-capture-group"?: RuleNoConfig;
|
|
1172
1190
|
"prefer-numeric-literals"?: RuleNoConfig;
|
|
@@ -1207,6 +1225,7 @@ interface DummyRuleMap {
|
|
|
1207
1225
|
"react/forbid-dom-props"?: RuleNoConfig | [AllowWarnDeny, ForbidDomPropsConfig];
|
|
1208
1226
|
"react/forbid-elements"?: RuleNoConfig | [AllowWarnDeny, ForbidElementsConfig];
|
|
1209
1227
|
"react/forward-ref-uses-ref"?: RuleNoConfig;
|
|
1228
|
+
"react/function-component-definition"?: RuleNoConfig | [AllowWarnDeny, FunctionComponentDefinitionConfig];
|
|
1210
1229
|
"react/hook-use-state"?: RuleNoConfig | [AllowWarnDeny, HookUseStateConfig];
|
|
1211
1230
|
"react/iframe-missing-sandbox"?: RuleNoConfig;
|
|
1212
1231
|
"react/jsx-boolean-value"?: RuleNoConfig | [AllowWarnDeny, EnforceBooleanAttribute] | [AllowWarnDeny, EnforceBooleanAttribute, JsxBooleanValueOptions];
|
|
@@ -1392,6 +1411,7 @@ interface DummyRuleMap {
|
|
|
1392
1411
|
"unicorn/error-message"?: RuleNoConfig;
|
|
1393
1412
|
"unicorn/escape-case"?: RuleNoConfig;
|
|
1394
1413
|
"unicorn/explicit-length-check"?: RuleNoConfig | [AllowWarnDeny, ExplicitLengthCheck];
|
|
1414
|
+
"unicorn/explicit-timer-delay"?: RuleNoConfig | [AllowWarnDeny, ExplicitTimerDelayMode];
|
|
1395
1415
|
"unicorn/filename-case"?: DummyRule;
|
|
1396
1416
|
"unicorn/import-style"?: RuleNoConfig | [AllowWarnDeny, ImportStyleConfig];
|
|
1397
1417
|
"unicorn/max-nested-calls"?: RuleNoConfig | [AllowWarnDeny, MaxNestedCalls];
|
|
@@ -1408,6 +1428,7 @@ interface DummyRuleMap {
|
|
|
1408
1428
|
"unicorn/no-array-sort"?: RuleNoConfig | [AllowWarnDeny, NoArraySort];
|
|
1409
1429
|
"unicorn/no-await-expression-member"?: RuleNoConfig;
|
|
1410
1430
|
"unicorn/no-await-in-promise-methods"?: RuleNoConfig;
|
|
1431
|
+
"unicorn/no-confusing-array-with"?: RuleNoConfig;
|
|
1411
1432
|
"unicorn/no-console-spaces"?: RuleNoConfig;
|
|
1412
1433
|
"unicorn/no-document-cookie"?: RuleNoConfig;
|
|
1413
1434
|
"unicorn/no-empty-file"?: RuleNoConfig;
|
|
@@ -1549,6 +1570,7 @@ interface DummyRuleMap {
|
|
|
1549
1570
|
"vitest/no-test-return-statement"?: RuleNoConfig;
|
|
1550
1571
|
"vitest/no-unneeded-async-expect-function"?: RuleNoConfig;
|
|
1551
1572
|
"vitest/padding-around-after-all-blocks"?: RuleNoConfig;
|
|
1573
|
+
"vitest/padding-around-test-blocks"?: RuleNoConfig;
|
|
1552
1574
|
"vitest/prefer-called-exactly-once-with"?: RuleNoConfig;
|
|
1553
1575
|
"vitest/prefer-called-once"?: RuleNoConfig;
|
|
1554
1576
|
"vitest/prefer-called-times"?: RuleNoConfig;
|
|
@@ -2269,6 +2291,7 @@ interface PreferEndingWithAnExpectConfig {
|
|
|
2269
2291
|
additionalTestBlockFunctions?: string[];
|
|
2270
2292
|
/**
|
|
2271
2293
|
* A list of function names that should be treated as assertion functions.
|
|
2294
|
+
* Default: `["expect"]`
|
|
2272
2295
|
*/
|
|
2273
2296
|
assertFunctionNames?: string[];
|
|
2274
2297
|
}
|
|
@@ -2343,6 +2366,56 @@ interface NoDefaultsConfig {
|
|
|
2343
2366
|
*/
|
|
2344
2367
|
noOptionalParamNames?: boolean;
|
|
2345
2368
|
}
|
|
2369
|
+
interface RequireParamConfig {
|
|
2370
|
+
/**
|
|
2371
|
+
* Whether to check constructor methods.
|
|
2372
|
+
*/
|
|
2373
|
+
checkConstructors?: boolean;
|
|
2374
|
+
/**
|
|
2375
|
+
* Whether to check destructured parameters.
|
|
2376
|
+
*/
|
|
2377
|
+
checkDestructured?: boolean;
|
|
2378
|
+
/**
|
|
2379
|
+
* Whether to check destructured parameters when you have code like
|
|
2380
|
+
* `function doSomething({ a, b }) { ... }`. Because there is no named
|
|
2381
|
+
* parameter in this example, when this option is `true` you must
|
|
2382
|
+
* have a `@param` tag that corresponds to `{a, b}`.
|
|
2383
|
+
*/
|
|
2384
|
+
checkDestructuredRoots?: boolean;
|
|
2385
|
+
/**
|
|
2386
|
+
* Whether to check getter methods.
|
|
2387
|
+
*/
|
|
2388
|
+
checkGetters?: boolean;
|
|
2389
|
+
/**
|
|
2390
|
+
* Whether to check rest properties.
|
|
2391
|
+
*/
|
|
2392
|
+
checkRestProperty?: boolean;
|
|
2393
|
+
/**
|
|
2394
|
+
* Whether to check setter methods.
|
|
2395
|
+
*/
|
|
2396
|
+
checkSetters?: boolean;
|
|
2397
|
+
/**
|
|
2398
|
+
* Regex pattern to match types that exempt parameters from checking.
|
|
2399
|
+
*/
|
|
2400
|
+
checkTypesPattern?: string;
|
|
2401
|
+
/**
|
|
2402
|
+
* List of JSDoc tags that exempt functions from `@param` checking.
|
|
2403
|
+
*/
|
|
2404
|
+
exemptedBy?: string[];
|
|
2405
|
+
/**
|
|
2406
|
+
* Set to `true` to ignore reporting when all params are missing. Defaults to `false`.
|
|
2407
|
+
*/
|
|
2408
|
+
ignoreWhenAllParamsMissing?: boolean;
|
|
2409
|
+
/**
|
|
2410
|
+
* Set if you wish TypeScript interfaces to exempt checks for the existence of `@param`'s.
|
|
2411
|
+
* Will check for a type defining the function itself (on a variable declaration) or if there is a single destructured object with a type. Defaults to `false`.
|
|
2412
|
+
*/
|
|
2413
|
+
interfaceExemptsParamsCheck?: boolean;
|
|
2414
|
+
/**
|
|
2415
|
+
* Set to `true` if you wish to expect documentation of properties on objects supplied as default values. Defaults to `false`.
|
|
2416
|
+
*/
|
|
2417
|
+
useDefaultObjectProperties?: boolean;
|
|
2418
|
+
}
|
|
2346
2419
|
interface RequireParamDescriptionConfig {
|
|
2347
2420
|
/**
|
|
2348
2421
|
* The description string to set by default for destructured roots. Defaults to "The root object".
|
|
@@ -2793,6 +2866,9 @@ interface NoConsoleConfig {
|
|
|
2793
2866
|
*/
|
|
2794
2867
|
allow?: string[];
|
|
2795
2868
|
}
|
|
2869
|
+
interface NoConstantBinaryExpressionConfig {
|
|
2870
|
+
checkRelationalComparisons?: boolean;
|
|
2871
|
+
}
|
|
2796
2872
|
interface NoConstantCondition {
|
|
2797
2873
|
/**
|
|
2798
2874
|
* Configuration option to specify whether to check for constant conditions in loops.
|
|
@@ -3019,6 +3095,10 @@ interface NoInnerDeclarationsOptions {
|
|
|
3019
3095
|
* Controls whether function declarations in nested blocks are allowed in strict mode (ES6+ behavior).
|
|
3020
3096
|
*/
|
|
3021
3097
|
blockScopedFunctions?: BlockScopedFunctions;
|
|
3098
|
+
/**
|
|
3099
|
+
* Controls whether declarations directly inside TypeScript namespace or module bodies are allowed.
|
|
3100
|
+
*/
|
|
3101
|
+
namespaces?: Namespaces;
|
|
3022
3102
|
}
|
|
3023
3103
|
interface NoInvalidRegexpConfig {
|
|
3024
3104
|
/**
|
|
@@ -3469,6 +3549,9 @@ interface NoUnneededTernary {
|
|
|
3469
3549
|
*/
|
|
3470
3550
|
defaultAssignment?: boolean;
|
|
3471
3551
|
}
|
|
3552
|
+
interface NoUnreachableLoopConfig {
|
|
3553
|
+
ignore?: LoopType[];
|
|
3554
|
+
}
|
|
3472
3555
|
interface NoUnsafeNegation {
|
|
3473
3556
|
/**
|
|
3474
3557
|
* The `enforceForOrderingRelations` option determines whether negation is allowed
|
|
@@ -3869,6 +3952,14 @@ interface NoSyncConfig {
|
|
|
3869
3952
|
*/
|
|
3870
3953
|
ignores?: string[];
|
|
3871
3954
|
}
|
|
3955
|
+
interface NoTopLevelAwaitConfig {
|
|
3956
|
+
/**
|
|
3957
|
+
* If `true`, top-level `await` is allowed in files that start with a
|
|
3958
|
+
* hashbang (`#!`), which marks them as executable scripts rather than
|
|
3959
|
+
* importable modules.
|
|
3960
|
+
*/
|
|
3961
|
+
ignoreBin?: boolean;
|
|
3962
|
+
}
|
|
3872
3963
|
interface ObjectShorthandOptions {
|
|
3873
3964
|
avoidExplicitReturnArrows?: boolean;
|
|
3874
3965
|
avoidQuotes?: boolean;
|
|
@@ -3971,7 +4062,8 @@ interface PreferDestructuringAssignmentConfig {
|
|
|
3971
4062
|
AssignmentExpression?: PreferDestructuringTargetOption;
|
|
3972
4063
|
VariableDeclarator?: PreferDestructuringTargetOption;
|
|
3973
4064
|
}
|
|
3974
|
-
interface
|
|
4065
|
+
interface PreferDestructuringEnforcementConfig {
|
|
4066
|
+
enforceForDeclarationWithTypeAnnotation?: boolean;
|
|
3975
4067
|
enforceForRenamedProperties?: boolean;
|
|
3976
4068
|
}
|
|
3977
4069
|
interface PreferPromiseRejectErrors {
|
|
@@ -4253,20 +4345,20 @@ interface ForbidItemObject {
|
|
|
4253
4345
|
* Component names for which this prop is **allowed** (all others are
|
|
4254
4346
|
* forbidden).
|
|
4255
4347
|
*/
|
|
4256
|
-
allowedFor
|
|
4348
|
+
allowedFor?: string[];
|
|
4257
4349
|
/**
|
|
4258
4350
|
* Glob patterns for component names where the prop is **allowed**.
|
|
4259
4351
|
*/
|
|
4260
|
-
allowedForPatterns
|
|
4352
|
+
allowedForPatterns?: string[];
|
|
4261
4353
|
/**
|
|
4262
4354
|
* Component names for which this prop is **disallowed** (all others are
|
|
4263
4355
|
* allowed).
|
|
4264
4356
|
*/
|
|
4265
|
-
disallowedFor
|
|
4357
|
+
disallowedFor?: string[];
|
|
4266
4358
|
/**
|
|
4267
4359
|
* Glob patterns for component names where the prop is **disallowed**.
|
|
4268
4360
|
*/
|
|
4269
|
-
disallowedForPatterns
|
|
4361
|
+
disallowedForPatterns?: string[];
|
|
4270
4362
|
/**
|
|
4271
4363
|
* Custom message to display.
|
|
4272
4364
|
*/
|
|
@@ -4288,7 +4380,7 @@ interface ForbidDomPropsConfig {
|
|
|
4288
4380
|
* An array of prop names or objects that are forbidden on DOM elements.
|
|
4289
4381
|
*
|
|
4290
4382
|
* Each array element can be a string with the property name, or an object
|
|
4291
|
-
* with `propName`,
|
|
4383
|
+
* with `propName`, optional `disallowedFor` and `disallowedValues` arrays,
|
|
4292
4384
|
* and an optional custom `message`.
|
|
4293
4385
|
*
|
|
4294
4386
|
* Examples:
|
|
@@ -4296,11 +4388,13 @@ interface ForbidDomPropsConfig {
|
|
|
4296
4388
|
* - `["error", { "forbid": ["id", "style"] }]`
|
|
4297
4389
|
* - `["error", { "forbid": [{ "propName": "className", "message": "Use class instead" }] }]`
|
|
4298
4390
|
* - `["error", { "forbid": [{ "propName": "style", "disallowedFor": ["div", "span"] }] }]`
|
|
4391
|
+
* - `["error", { "forbid": [{ "propName": "type", "disallowedValues": ["button"] }] }]`
|
|
4299
4392
|
*/
|
|
4300
4393
|
forbid?: ForbidDomPropsItem[];
|
|
4301
4394
|
}
|
|
4302
4395
|
/**
|
|
4303
|
-
* A prop with optional `disallowedFor` DOM node list
|
|
4396
|
+
* A prop with optional `disallowedFor` DOM node list, optional `disallowedValues`
|
|
4397
|
+
* value list, and custom `message`.
|
|
4304
4398
|
*/
|
|
4305
4399
|
interface PropWithOptions {
|
|
4306
4400
|
/**
|
|
@@ -4309,6 +4403,11 @@ interface PropWithOptions {
|
|
|
4309
4403
|
* DOM elements.
|
|
4310
4404
|
*/
|
|
4311
4405
|
disallowedFor?: string[];
|
|
4406
|
+
/**
|
|
4407
|
+
* A list of string literal values for which this prop is forbidden. If
|
|
4408
|
+
* omitted, the prop is forbidden for all values.
|
|
4409
|
+
*/
|
|
4410
|
+
disallowedValues?: string[];
|
|
4312
4411
|
/**
|
|
4313
4412
|
* A custom message to display when this prop is used.
|
|
4314
4413
|
*/
|
|
@@ -4330,6 +4429,10 @@ interface ForbidElementsConfig {
|
|
|
4330
4429
|
*/
|
|
4331
4430
|
forbid?: ForbidItem2[];
|
|
4332
4431
|
}
|
|
4432
|
+
interface FunctionComponentDefinitionConfig {
|
|
4433
|
+
namedComponents?: NamedComponents;
|
|
4434
|
+
unnamedComponents?: UnnamedComponents;
|
|
4435
|
+
}
|
|
4333
4436
|
interface HookUseStateConfig {
|
|
4334
4437
|
/**
|
|
4335
4438
|
* When true the rule will ignore the name of the destructured value.
|
|
@@ -5776,7 +5879,13 @@ interface TripleSlashReferenceConfig {
|
|
|
5776
5879
|
* What to enforce for `/// <reference lib="..." />` references.
|
|
5777
5880
|
*/
|
|
5778
5881
|
lib?: AlwaysNever;
|
|
5882
|
+
/**
|
|
5883
|
+
* What to enforce for `/// <reference path="..." />` references.
|
|
5884
|
+
*/
|
|
5779
5885
|
path?: PathOption;
|
|
5886
|
+
/**
|
|
5887
|
+
* What to enforce for `/// <reference types="..." />` references.
|
|
5888
|
+
*/
|
|
5780
5889
|
types?: TypesOption;
|
|
5781
5890
|
}
|
|
5782
5891
|
interface UnboundMethodConfig {
|
|
@@ -5960,6 +6069,16 @@ interface NoArrayReverse {
|
|
|
5960
6069
|
allowExpressionStatement?: boolean;
|
|
5961
6070
|
}
|
|
5962
6071
|
interface NoArraySort {
|
|
6072
|
+
/**
|
|
6073
|
+
* When set to `true`, allows sorting a fresh array created by a spread, e.g. `[...iterable].sort()`.
|
|
6074
|
+
* This avoids the double allocation of `toSorted()` when sorting an iterable such as a `Set`.
|
|
6075
|
+
*
|
|
6076
|
+
* Example of **correct** code for this rule with `allowAfterSpread` set to `true`:
|
|
6077
|
+
* ```js
|
|
6078
|
+
* const sorted = [...mySet].sort();
|
|
6079
|
+
* ```
|
|
6080
|
+
*/
|
|
6081
|
+
allowAfterSpread?: boolean;
|
|
5963
6082
|
/**
|
|
5964
6083
|
* When set to `true` (default), allows `array.sort()` as an expression statement.
|
|
5965
6084
|
* Set to `false` to forbid `Array#sort()` even if it's an expression statement.
|
|
@@ -6302,6 +6421,9 @@ interface NoReservedPropsConfig {
|
|
|
6302
6421
|
vueVersion?: number;
|
|
6303
6422
|
}
|
|
6304
6423
|
interface Options$1 {
|
|
6424
|
+
/**
|
|
6425
|
+
* Prop names to ignore, as regular expression patterns.
|
|
6426
|
+
*/
|
|
6305
6427
|
ignoreProps?: string[];
|
|
6306
6428
|
}
|
|
6307
6429
|
interface RequireDirectExport {
|
|
@@ -6620,18 +6742,13 @@ interface VitestPluginSettings {
|
|
|
6620
6742
|
*/
|
|
6621
6743
|
typecheck?: boolean;
|
|
6622
6744
|
[k: string]: unknown | undefined;
|
|
6623
|
-
}
|
|
6745
|
+
}
|
|
6746
|
+
//#endregion
|
|
6624
6747
|
//#region src-js/package/config.d.ts
|
|
6625
6748
|
type Oxlintrc = Omit<Oxlintrc$1, "$schema" | "extends">;
|
|
6626
6749
|
interface OxlintConfig$1 extends Oxlintrc {
|
|
6627
6750
|
extends?: OxlintConfig$1[];
|
|
6628
6751
|
}
|
|
6629
|
-
/**
|
|
6630
|
-
* Define an Oxlint configuration with type inference.
|
|
6631
|
-
*
|
|
6632
|
-
* @param config - Oxlint configuration
|
|
6633
|
-
* @returns Config unchanged
|
|
6634
|
-
*/
|
|
6635
6752
|
//#endregion
|
|
6636
6753
|
//#region src/types.d.ts
|
|
6637
6754
|
/**
|
|
@@ -6704,7 +6821,9 @@ declare namespace ESLint {
|
|
|
6704
6821
|
ignores?: string[];
|
|
6705
6822
|
/** Language options including globals, parser, etc */
|
|
6706
6823
|
languageOptions?: {
|
|
6707
|
-
/** Global variables */
|
|
6824
|
+
/** Global variables */
|
|
6825
|
+
globals?: GlobalsConfig;
|
|
6826
|
+
/** Parser options */
|
|
6708
6827
|
parserOptions?: Record<string, unknown>;
|
|
6709
6828
|
[key: string]: unknown;
|
|
6710
6829
|
};
|
package/dist/src/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as main } from "../src-
|
|
1
|
+
import { t as main } from "../src-V0W_ayvY.mjs";
|
|
2
2
|
export { main as default };
|
|
@@ -389,7 +389,8 @@ const cleanUpUnusedJsPlugins = (config) => {
|
|
|
389
389
|
if (config.jsPlugins === void 0 || config.jsPlugins === null || config.jsPlugins.length === 0) return;
|
|
390
390
|
const ruleNames = Object.keys(config.rules ?? {});
|
|
391
391
|
config.jsPlugins = config.jsPlugins.filter((entry) => {
|
|
392
|
-
|
|
392
|
+
const packageName = typeof entry === "string" ? entry : entry.specifier;
|
|
393
|
+
return hasRulesForPlugin(ruleNames, packageName);
|
|
393
394
|
});
|
|
394
395
|
if (config.jsPlugins.length === 0) delete config.jsPlugins;
|
|
395
396
|
};
|
|
@@ -661,6 +662,7 @@ const styleRules = [
|
|
|
661
662
|
"promise/prefer-await-to-callbacks",
|
|
662
663
|
"promise/prefer-await-to-then",
|
|
663
664
|
"promise/prefer-catch",
|
|
665
|
+
"react/function-component-definition",
|
|
664
666
|
"react/hook-use-state",
|
|
665
667
|
"react/jsx-boolean-value",
|
|
666
668
|
"react/jsx-curly-brace-presence",
|
|
@@ -706,6 +708,7 @@ const styleRules = [
|
|
|
706
708
|
"unicorn/custom-error-definition",
|
|
707
709
|
"unicorn/empty-brace-spaces",
|
|
708
710
|
"unicorn/error-message",
|
|
711
|
+
"unicorn/explicit-timer-delay",
|
|
709
712
|
"unicorn/filename-case",
|
|
710
713
|
"unicorn/max-nested-calls",
|
|
711
714
|
"unicorn/no-array-method-this-argument",
|
|
@@ -768,6 +771,7 @@ const styleRules = [
|
|
|
768
771
|
"vitest/no-test-return-statement",
|
|
769
772
|
"vitest/no-unneeded-async-expect-function",
|
|
770
773
|
"vitest/padding-around-after-all-blocks",
|
|
774
|
+
"vitest/padding-around-test-blocks",
|
|
771
775
|
"vitest/prefer-called-exactly-once-with",
|
|
772
776
|
"vitest/prefer-called-once",
|
|
773
777
|
"vitest/prefer-called-times",
|
|
@@ -862,6 +866,7 @@ const suspiciousRules = [
|
|
|
862
866
|
"unicorn/no-array-fill-with-reference-type",
|
|
863
867
|
"unicorn/no-array-reverse",
|
|
864
868
|
"unicorn/no-array-sort",
|
|
869
|
+
"unicorn/no-confusing-array-with",
|
|
865
870
|
"unicorn/no-instanceof-builtins",
|
|
866
871
|
"unicorn/prefer-add-event-listener",
|
|
867
872
|
"unicorn/require-module-specifiers",
|
|
@@ -913,6 +918,7 @@ const restrictionRules = [
|
|
|
913
918
|
"node/no-new-require",
|
|
914
919
|
"node/no-path-concat",
|
|
915
920
|
"node/no-process-env",
|
|
921
|
+
"node/no-top-level-await",
|
|
916
922
|
"promise/catch-or-return",
|
|
917
923
|
"promise/spec-only",
|
|
918
924
|
"react/button-has-type",
|
|
@@ -1238,6 +1244,7 @@ const perfRules = [
|
|
|
1238
1244
|
const nurseryRules = [
|
|
1239
1245
|
"no-restricted-exports",
|
|
1240
1246
|
"no-undef",
|
|
1247
|
+
"no-unreachable-loop",
|
|
1241
1248
|
"no-useless-assignment",
|
|
1242
1249
|
"import/export",
|
|
1243
1250
|
"import/named",
|
|
@@ -1320,6 +1327,25 @@ var unsupportedRules = {
|
|
|
1320
1327
|
"import/no-unresolved": "Will always contain false positives due to module resolution complexity.",
|
|
1321
1328
|
"promise/no-native": "Handled by `eslint/no-undef`.",
|
|
1322
1329
|
"unicorn/no-for-loop": "This rule suggests using `Array.prototype.entries` which is slow https://github.com/oxc-project/oxc/issues/11311, furthermore, `typescript/prefer-for-of` covers most cases.",
|
|
1330
|
+
"unicorn/no-useless-coercion": "No need to implement, already implemented by `typescript/no-unnecessary-type-conversion` via tsgolint.",
|
|
1331
|
+
"unicorn/no-unnecessary-boolean-comparison": "No need to implement, already implemented by `typescript/no-unnecessary-boolean-literal-compare` via tsgolint.",
|
|
1332
|
+
"unicorn/no-nonstandard-builtin-properties": "No need to implement, TypeScript type checking reports non-standard properties and invalid calls or constructions on built-ins.",
|
|
1333
|
+
"unicorn/no-boolean-sort-comparator": "No need to implement, TypeScript type checking requires array sort comparators to return numbers.",
|
|
1334
|
+
"unicorn/no-invalid-argument-count": "No need to implement, TypeScript type checking reports invalid argument counts for functions, constructors, and built-in APIs.",
|
|
1335
|
+
"unicorn/no-useless-template-literals": "No need to implement. `typescript/no-unnecessary-template-expression` covers static and already-string expressions, while `eslint/no-implicit-coercion` with `disallowTemplateShorthand` covers expression-only string coercions.",
|
|
1336
|
+
"unicorn/prefer-explicit-viewport-units": "Not currently possible, as full support requires parsing standalone CSS files.",
|
|
1337
|
+
"unicorn/require-frontmatter-fields": "Not currently possible, as it requires parsing YAML frontmatter in Markdown files.",
|
|
1338
|
+
"unicorn/no-missing-local-resource": "Not currently possible, as it requires parsing standalone Markdown, HTML, and CSS files and resolving their local resources.",
|
|
1339
|
+
"unicorn/no-transition-all": "Not currently possible, as full support requires parsing standalone CSS files.",
|
|
1340
|
+
"unicorn/no-shorthand-property-overrides": "Not currently possible, as it requires parsing standalone CSS files.",
|
|
1341
|
+
"unicorn/require-proxy-trap-boolean-return": "No need to implement, TypeScript type checking enforces boolean return types for the relevant `ProxyHandler` traps.",
|
|
1342
|
+
"unicorn/consistent-class-member-order": "Use `typescript/member-ordering` instead, which can be configured with the same class member group order and will be supported in Oxlint.",
|
|
1343
|
+
"unicorn/no-collection-bracket-access": "No need to implement, TypeScript type checking reports invalid bracket access on `Map`, `Set`, `WeakMap`, and `WeakSet` values.",
|
|
1344
|
+
"unicorn/no-accidental-bitwise-operator": "No need to implement, already covered by `oxc/bad-bitwise-operator`.",
|
|
1345
|
+
"unicorn/no-misrefactored-assignment": "No need to implement, already covered by `oxc/misrefactored-assign-op`.",
|
|
1346
|
+
"unicorn/no-constant-zero-expression": "No need to implement, already covered by `oxc/erasing-op`.",
|
|
1347
|
+
"unicorn/prefer-math-constants": "No need to implement, already covered by `oxc/approx-constant`.",
|
|
1348
|
+
"unicorn/require-array-sort-compare": "No need to implement, already implemented by `typescript/require-array-sort-compare` via tsgolint.",
|
|
1323
1349
|
"eslint/no-negated-in-lhs": "Replaced by `eslint/no-unsafe-negation`, which we support.",
|
|
1324
1350
|
"eslint/no-catch-shadow": "Replaced by `eslint/no-shadow`.",
|
|
1325
1351
|
"eslint/id-blacklist": "Replaced by `eslint/id-denylist`.",
|
|
@@ -1351,8 +1377,22 @@ var unsupportedRules = {
|
|
|
1351
1377
|
"import/no-deprecated": "No need to implement, already implemented by `typescript/no-deprecated` via tsgolint.",
|
|
1352
1378
|
"n/no-restricted-import": "No need to implement, already implemented by `no-restricted-imports` rule.",
|
|
1353
1379
|
"n/no-restricted-require": "No need to implement, already implemented by `no-restricted-imports` rule.",
|
|
1380
|
+
"n/prefer-global/buffer": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
|
|
1381
|
+
"n/prefer-global/console": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
|
|
1382
|
+
"n/prefer-global/crypto": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
|
|
1383
|
+
"n/prefer-global/process": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
|
|
1384
|
+
"n/prefer-global/text-decoder": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
|
|
1385
|
+
"n/prefer-global/text-encoder": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
|
|
1386
|
+
"n/prefer-global/timers": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
|
|
1387
|
+
"n/prefer-global/url": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
|
|
1388
|
+
"n/prefer-global/url-search-params": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
|
|
1389
|
+
"n/no-unpublished-bin": "No support for this rule in Oxlint, as it requires knowledge of the package.json file and its `bin` field.",
|
|
1354
1390
|
"import/order": "Not implementing this in Oxlint as its behavior is covered very well by [Oxfmt's import sorting](https://oxc.rs/docs/guide/usage/formatter/sorting.html).",
|
|
1355
1391
|
"unicorn/template-indent": "Stylistic rule.",
|
|
1392
|
+
"unicorn/no-non-function-verb-prefix": "Requires type information. Not currently possible to implement in oxlint.",
|
|
1393
|
+
"unicorn/prefer-json-parse-buffer": "Deprecated.",
|
|
1394
|
+
"unicorn/prevent-abbreviations": "Deprecated.",
|
|
1395
|
+
"unicorn/better-regex": "Deprecated.",
|
|
1356
1396
|
"jsdoc/type-formatting": "Experimental rule in the original plugin, may reconsider once stable.",
|
|
1357
1397
|
"jsdoc/convert-to-jsdoc-comments": "Experimental rule in the original plugin, may reconsider once stable.",
|
|
1358
1398
|
"jsdoc/check-examples": "Deprecated.",
|
|
@@ -1391,35 +1431,35 @@ var unsupportedRules = {
|
|
|
1391
1431
|
"react/jsx-sort-props": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1392
1432
|
"react/no-adjacent-inline-elements": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1393
1433
|
"react/no-deprecated": "No need to implement, already implemented by `typescript/no-deprecated` via tsgolint.",
|
|
1394
|
-
"react/config": "React Compiler rules
|
|
1395
|
-
"react/error-boundaries": "React Compiler rules
|
|
1396
|
-
"react/component-hook-factories": "React Compiler rules
|
|
1397
|
-
"react/gating": "React Compiler rules
|
|
1398
|
-
"react/globals": "React Compiler rules
|
|
1399
|
-
"react/immutability": "React Compiler rules
|
|
1400
|
-
"react/preserve-manual-memoization": "React Compiler rules
|
|
1401
|
-
"react/purity": "React Compiler rules
|
|
1402
|
-
"react/refs": "React Compiler rules
|
|
1403
|
-
"react/set-state-in-effect": "React Compiler rules
|
|
1404
|
-
"react/set-state-in-render": "React Compiler rules
|
|
1405
|
-
"react/static-components": "React Compiler rules
|
|
1406
|
-
"react/unsupported-syntax": "React Compiler rules
|
|
1407
|
-
"react/use-memo": "React Compiler rules
|
|
1408
|
-
"react/incompatible-library": "React Compiler rules
|
|
1409
|
-
"react/automatic-effect-dependencies": "React Compiler rules
|
|
1410
|
-
"react/memo-dependencies": "React Compiler rules
|
|
1411
|
-
"react/exhaustive-effect-dependencies": "React Compiler rules
|
|
1412
|
-
"react/capitalized-calls": "React Compiler rules
|
|
1413
|
-
"react/fbt": "React Compiler rules
|
|
1414
|
-
"react/fire": "React Compiler rules
|
|
1415
|
-
"react/invariant": "React Compiler rules
|
|
1416
|
-
"react/hooks": "React Compiler rules
|
|
1417
|
-
"react/memoized-effect-dependencies": "React Compiler rules
|
|
1418
|
-
"react/no-deriving-state-in-effects": "React Compiler rules
|
|
1419
|
-
"react/rule-suppression": "React Compiler rules
|
|
1420
|
-
"react/syntax": "React Compiler rules
|
|
1421
|
-
"react/todo": "React Compiler rules
|
|
1422
|
-
"react/void-use-memo": "React Compiler rules
|
|
1434
|
+
"react/config": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1435
|
+
"react/error-boundaries": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1436
|
+
"react/component-hook-factories": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1437
|
+
"react/gating": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1438
|
+
"react/globals": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1439
|
+
"react/immutability": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1440
|
+
"react/preserve-manual-memoization": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1441
|
+
"react/purity": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1442
|
+
"react/refs": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1443
|
+
"react/set-state-in-effect": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1444
|
+
"react/set-state-in-render": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1445
|
+
"react/static-components": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1446
|
+
"react/unsupported-syntax": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1447
|
+
"react/use-memo": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1448
|
+
"react/incompatible-library": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1449
|
+
"react/automatic-effect-dependencies": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1450
|
+
"react/memo-dependencies": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1451
|
+
"react/exhaustive-effect-dependencies": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1452
|
+
"react/capitalized-calls": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1453
|
+
"react/fbt": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1454
|
+
"react/fire": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1455
|
+
"react/invariant": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1456
|
+
"react/hooks": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1457
|
+
"react/memoized-effect-dependencies": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1458
|
+
"react/no-deriving-state-in-effects": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1459
|
+
"react/rule-suppression": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1460
|
+
"react/syntax": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1461
|
+
"react/todo": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1462
|
+
"react/void-use-memo": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1423
1463
|
"react/default-props-match-prop-types": "This rule only applies to legacy class components, which are not widely used in modern React. Also stylistic.",
|
|
1424
1464
|
"react/forbid-foreign-prop-types": "PropTypes are ignored in React 19, and this rule is only relevant for very specific use-cases involving it.",
|
|
1425
1465
|
"react/forbid-prop-types": "PropTypes are ignored in React 19, and this rule is only relevant if you use the PropTypes package.",
|
|
@@ -1518,6 +1558,7 @@ var unsupportedRules = {
|
|
|
1518
1558
|
"react/jsx-uses-vars": "Handled by `eslint/no-unused-vars`, which already evaluates whether vars are used in JSX.",
|
|
1519
1559
|
"unicorn/no-named-default": "Implemented via `import/no-named-default`.",
|
|
1520
1560
|
"unicorn/no-double-comparison": "Use `oxc/double-comparisons` instead.",
|
|
1561
|
+
"unicorn/no-chained-comparison": "Use `oxc/bad-comparison-sequence` instead. TypeScript also reports errors for these comparisons.",
|
|
1521
1562
|
"vue/no-lone-template": "Not currently possible, as it requires Vue template parsing.",
|
|
1522
1563
|
"vue/no-v-html": "Not currently possible, as it requires Vue template parsing.",
|
|
1523
1564
|
"vue/this-in-template": "Not currently possible, as it requires Vue template parsing.",
|
|
@@ -1642,6 +1683,7 @@ var unsupportedRules = {
|
|
|
1642
1683
|
"vue/prefer-separate-static-class": "Not currently possible, as it requires Vue template parsing.",
|
|
1643
1684
|
"vue/prefer-template": "Not currently possible, as it requires Vue template parsing.",
|
|
1644
1685
|
"vue/prefer-true-attribute-shorthand": "Not currently possible, as it requires Vue template parsing.",
|
|
1686
|
+
"vue/prefer-v-model": "Not currently possible, as it requires Vue template parsing.",
|
|
1645
1687
|
"vue/quote-props": "Stylistic rule.",
|
|
1646
1688
|
"vue/require-component-is": "Not currently possible, as it requires Vue template parsing.",
|
|
1647
1689
|
"vue/require-explicit-emits": "Not currently possible, as it requires Vue template parsing.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxlint/migrate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.75.0",
|
|
4
4
|
"description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -26,21 +26,10 @@
|
|
|
26
26
|
"types": "./dist/src/index.d.mts",
|
|
27
27
|
"import": "./dist/src/index.mjs"
|
|
28
28
|
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"prepare": "husky",
|
|
31
|
-
"generate": "node --import @oxc-node/core/register ./scripts/generate.ts",
|
|
32
|
-
"generate:unsupported": "node --import @oxc-node/core/register ./scripts/fetch-unsupported-rules.ts",
|
|
33
|
-
"generate:all": "pnpm generate && pnpm generate:unsupported && pnpm format",
|
|
34
|
-
"format": "oxfmt",
|
|
35
|
-
"lint": "oxlint",
|
|
36
|
-
"test": "vitest",
|
|
37
|
-
"build": "tsdown",
|
|
38
|
-
"manual-test": "pnpm build; chmod +x dist/bin/oxlint-migrate.mjs; npx ."
|
|
39
|
-
},
|
|
40
29
|
"dependencies": {
|
|
41
30
|
"commander": "^15.0.0",
|
|
42
31
|
"globals": "^17.0.0",
|
|
43
|
-
"oxc-parser": "^0.
|
|
32
|
+
"oxc-parser": "^0.139.0",
|
|
44
33
|
"tinyglobby": "^0.2.14"
|
|
45
34
|
},
|
|
46
35
|
"devDependencies": {
|
|
@@ -83,9 +72,9 @@
|
|
|
83
72
|
"husky": "^9.1.7",
|
|
84
73
|
"lint-staged": "^17.0.0",
|
|
85
74
|
"next": "^16.0.0",
|
|
86
|
-
"oxfmt": "^0.
|
|
87
|
-
"oxlint": "^1.
|
|
88
|
-
"oxlint-tsgolint": "^0.
|
|
75
|
+
"oxfmt": "^0.58.0",
|
|
76
|
+
"oxlint": "^1.75.0",
|
|
77
|
+
"oxlint-tsgolint": "^0.24.0",
|
|
89
78
|
"tsdown": "^0.22.0",
|
|
90
79
|
"typescript": "^6.0.0",
|
|
91
80
|
"typescript-eslint": "^8.35.0",
|
|
@@ -94,5 +83,14 @@
|
|
|
94
83
|
"lint-staged": {
|
|
95
84
|
"*": "oxfmt --no-error-on-unmatched-pattern"
|
|
96
85
|
},
|
|
97
|
-
"
|
|
98
|
-
|
|
86
|
+
"scripts": {
|
|
87
|
+
"generate": "node --import @oxc-node/core/register ./scripts/generate.ts",
|
|
88
|
+
"generate:unsupported": "node --import @oxc-node/core/register ./scripts/fetch-unsupported-rules.ts",
|
|
89
|
+
"generate:all": "pnpm generate && pnpm generate:unsupported && pnpm format",
|
|
90
|
+
"format": "oxfmt",
|
|
91
|
+
"lint": "oxlint",
|
|
92
|
+
"test": "vitest",
|
|
93
|
+
"build": "tsdown",
|
|
94
|
+
"manual-test": "pnpm build; chmod +x dist/bin/oxlint-migrate.mjs; npx ."
|
|
95
|
+
}
|
|
96
|
+
}
|