@oxlint/migrate 1.77.0 → 1.79.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
CHANGED
|
@@ -73,7 +73,7 @@ Not all `settings` options are supported by oxlint, and so rule behavior in cert
|
|
|
73
73
|
|
|
74
74
|
**Local ESLint Plugins imported via path are not migrated**
|
|
75
75
|
|
|
76
|
-
JS plugin migration cannot migrate ESLint plugins from file paths in the same repo currently (e.g. if you have `../eslint-plugin-myplugin` in your `eslint.config.mjs`). You will need to copy them over into the `jsPlugins` manually. See [the JS Plugins docs]() for more info.
|
|
76
|
+
JS plugin migration cannot migrate ESLint plugins from file paths in the same repo currently (e.g. if you have `../eslint-plugin-myplugin` in your `eslint.config.mjs`). You will need to copy them over into the `jsPlugins` manually. See [the JS Plugins docs](<>) for more info.
|
|
77
77
|
|
|
78
78
|
**`globals` field with large number of values**
|
|
79
79
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
@@ -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-NHsLuNLs.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.79.0";
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/walker/comments/replaceRuleDirectiveComment.ts
|
|
36
36
|
const allRulesSet = new Set(Object.values(rules_exports).flat());
|
|
@@ -114,11 +114,13 @@ function extractScriptBlocks(sourceText, offset, maxBlocks, parseLangAttribute)
|
|
|
114
114
|
if (c === inQuote) inQuote = null;
|
|
115
115
|
} else if (c === "\"" || c === "'") inQuote = c;
|
|
116
116
|
else if (c === "<") genericDepth++;
|
|
117
|
-
else if (c === ">")
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
else if (c === ">") {
|
|
118
|
+
if (genericDepth > 0) genericDepth--;
|
|
119
|
+
else {
|
|
120
|
+
if (i > idx && sourceText[i - 1] === "/") selfClosing = true;
|
|
121
|
+
i++;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
122
124
|
}
|
|
123
125
|
i++;
|
|
124
126
|
}
|
package/dist/src/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
/**
|
|
11
11
|
* What to enforce for `/// <reference types="..." />` references.
|
|
12
12
|
*/
|
|
13
|
-
//#region node_modules/.pnpm/oxlint@1.
|
|
13
|
+
//#region node_modules/.pnpm/oxlint@1.79.0_oxlint-tsgolint@0.25.0/node_modules/oxlint/dist/index.d.ts
|
|
14
14
|
//#region src-js/package/config.generated.d.ts
|
|
15
15
|
type AllowWarnDeny = ("allow" | "off" | "warn" | "error" | "deny") | number;
|
|
16
16
|
type GlobalValue = ("readonly" | "writable" | "off") | undefined;
|
|
@@ -163,6 +163,18 @@ type ExportsStyleMode = "module.exports" | "exports";
|
|
|
163
163
|
type HandleCallbackErrConfig = string;
|
|
164
164
|
type NoMixedRequiresConfig = boolean | NoMixedRequiresOptions;
|
|
165
165
|
type ShorthandType = "always" | "methods" | "properties" | "consistent" | "consistent-as-needed" | "never";
|
|
166
|
+
/**
|
|
167
|
+
* Enforces consistent grouping of variable declarations.
|
|
168
|
+
*/
|
|
169
|
+
type OneVar = OneVarConfig;
|
|
170
|
+
/**
|
|
171
|
+
* Configuration accepted by the `one-var` rule.
|
|
172
|
+
*/
|
|
173
|
+
type OneVarConfig = OneVarMode | OneVarOptions;
|
|
174
|
+
/**
|
|
175
|
+
* Controls how variable declarators are grouped into declarations.
|
|
176
|
+
*/
|
|
177
|
+
type OneVarMode = "always" | "never" | "consecutive";
|
|
166
178
|
type Destructuring = "any" | "all";
|
|
167
179
|
type PreferDestructuringOption = PreferDestructuringTargetOption | PreferDestructuringAssignmentConfig;
|
|
168
180
|
type TerminationMethod = string | string[];
|
|
@@ -210,9 +222,7 @@ type ImportKind = "none" | "all" | "multiple" | "single";
|
|
|
210
222
|
type SortOrder = "desc" | "asc";
|
|
211
223
|
type ArrayOption = "array" | "array-simple" | "generic";
|
|
212
224
|
type ReadonlyArrayOption = "array" | "array-simple" | "generic";
|
|
213
|
-
type DirectiveConfigSchema = boolean | RequireDescription |
|
|
214
|
-
descriptionFormat?: string;
|
|
215
|
-
};
|
|
225
|
+
type DirectiveConfigSchema = boolean | RequireDescription | DescriptionFormatConfig;
|
|
216
226
|
type RequireDescription = "allow-with-description";
|
|
217
227
|
type ClassLiteralPropertyStyleOption = "fields" | "getters";
|
|
218
228
|
type PreferGenericType = "constructor" | "type-annotation";
|
|
@@ -853,7 +863,7 @@ interface DummyRuleMap {
|
|
|
853
863
|
"getter-return"?: RuleNoConfig | [AllowWarnDeny, GetterReturn];
|
|
854
864
|
"grouped-accessor-pairs"?: RuleNoConfig | [AllowWarnDeny, PairOrder] | [AllowWarnDeny, PairOrder, GroupedAccessorPairsConfig];
|
|
855
865
|
"guard-for-in"?: RuleNoConfig;
|
|
856
|
-
"id-denylist"?: RuleNoConfig | [AllowWarnDeny,
|
|
866
|
+
"id-denylist"?: RuleNoConfig | [AllowWarnDeny, ...string[]];
|
|
857
867
|
"id-length"?: RuleNoConfig | [AllowWarnDeny, IdLengthConfig];
|
|
858
868
|
"id-match"?: RuleNoConfig | [AllowWarnDeny, string] | [AllowWarnDeny, string, IdMatchOptions];
|
|
859
869
|
"import/consistent-type-specifier-style"?: RuleNoConfig | [AllowWarnDeny, Mode];
|
|
@@ -955,6 +965,7 @@ interface DummyRuleMap {
|
|
|
955
965
|
"jsdoc/check-tag-names"?: RuleNoConfig | [AllowWarnDeny, CheckTagNamesConfig];
|
|
956
966
|
"jsdoc/empty-tags"?: RuleNoConfig | [AllowWarnDeny, EmptyTagsConfig];
|
|
957
967
|
"jsdoc/implements-on-classes"?: RuleNoConfig;
|
|
968
|
+
"jsdoc/no-blank-blocks"?: RuleNoConfig | [AllowWarnDeny, NoBlankBlocks];
|
|
958
969
|
"jsdoc/no-defaults"?: RuleNoConfig | [AllowWarnDeny, NoDefaultsConfig];
|
|
959
970
|
"jsdoc/require-param"?: RuleNoConfig | [AllowWarnDeny, RequireParamConfig];
|
|
960
971
|
"jsdoc/require-param-description"?: RuleNoConfig | [AllowWarnDeny, RequireParamDescriptionConfig];
|
|
@@ -974,7 +985,7 @@ interface DummyRuleMap {
|
|
|
974
985
|
"jsdoc/require-yields-type"?: RuleNoConfig;
|
|
975
986
|
"jsx-a11y/alt-text"?: RuleNoConfig | [AllowWarnDeny, AltTextConfigSchema];
|
|
976
987
|
"jsx-a11y/anchor-ambiguous-text"?: RuleNoConfig | [AllowWarnDeny, AnchorAmbiguousTextConfig];
|
|
977
|
-
"jsx-a11y/anchor-has-content"?: RuleNoConfig;
|
|
988
|
+
"jsx-a11y/anchor-has-content"?: RuleNoConfig | [AllowWarnDeny, AnchorHasContentConfig];
|
|
978
989
|
"jsx-a11y/anchor-is-valid"?: RuleNoConfig | [AllowWarnDeny, AnchorIsValidConfig];
|
|
979
990
|
"jsx-a11y/aria-activedescendant-has-tabindex"?: RuleNoConfig;
|
|
980
991
|
"jsx-a11y/aria-props"?: RuleNoConfig;
|
|
@@ -1115,9 +1126,9 @@ interface DummyRuleMap {
|
|
|
1115
1126
|
"no-redeclare"?: RuleNoConfig | [AllowWarnDeny, NoRedeclare];
|
|
1116
1127
|
"no-regex-spaces"?: RuleNoConfig;
|
|
1117
1128
|
"no-restricted-exports"?: RuleNoConfig | [AllowWarnDeny, NoRestrictedExportsConfig];
|
|
1118
|
-
"no-restricted-globals"?: RuleNoConfig | [AllowWarnDeny,
|
|
1119
|
-
"no-restricted-imports"?: RuleNoConfig | [AllowWarnDeny,
|
|
1120
|
-
"no-restricted-properties"?: RuleNoConfig | [AllowWarnDeny,
|
|
1129
|
+
"no-restricted-globals"?: RuleNoConfig | [AllowWarnDeny, ...NoRestrictedGlobalsConfigEnum[]];
|
|
1130
|
+
"no-restricted-imports"?: RuleNoConfig | [AllowWarnDeny, ...NoRestrictedImportsConfigEnum[]];
|
|
1131
|
+
"no-restricted-properties"?: RuleNoConfig | [AllowWarnDeny, ...PropertyDetails[]];
|
|
1121
1132
|
"no-return-assign"?: RuleNoConfig | [AllowWarnDeny, NoReturnAssignMode];
|
|
1122
1133
|
"no-script-url"?: RuleNoConfig;
|
|
1123
1134
|
"no-self-assign"?: RuleNoConfig | [AllowWarnDeny, NoSelfAssign];
|
|
@@ -1174,6 +1185,7 @@ interface DummyRuleMap {
|
|
|
1174
1185
|
"node/no-sync"?: RuleNoConfig | [AllowWarnDeny, NoSyncConfig];
|
|
1175
1186
|
"node/no-top-level-await"?: RuleNoConfig | [AllowWarnDeny, NoTopLevelAwaitConfig];
|
|
1176
1187
|
"object-shorthand"?: RuleNoConfig | [AllowWarnDeny, ShorthandType] | [AllowWarnDeny, ShorthandType, ObjectShorthandOptions];
|
|
1188
|
+
"one-var"?: RuleNoConfig | [AllowWarnDeny, OneVar];
|
|
1177
1189
|
"operator-assignment"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever];
|
|
1178
1190
|
"oxc/approx-constant"?: RuleNoConfig;
|
|
1179
1191
|
"oxc/bad-array-method-on-arguments"?: RuleNoConfig;
|
|
@@ -1238,16 +1250,24 @@ interface DummyRuleMap {
|
|
|
1238
1250
|
"react-perf/jsx-no-new-function-as-prop"?: RuleNoConfig | [AllowWarnDeny, ReactPerfConfig];
|
|
1239
1251
|
"react-perf/jsx-no-new-object-as-prop"?: RuleNoConfig | [AllowWarnDeny, ReactPerfConfig];
|
|
1240
1252
|
"react/button-has-type"?: RuleNoConfig | [AllowWarnDeny, ButtonHasType];
|
|
1253
|
+
"react/capitalized-calls"?: RuleNoConfig;
|
|
1241
1254
|
"react/checked-requires-onchange-or-readonly"?: RuleNoConfig | [AllowWarnDeny, CheckedRequiresOnchangeOrReadonly];
|
|
1242
1255
|
"react/display-name"?: RuleNoConfig | [AllowWarnDeny, DisplayNameConfig];
|
|
1256
|
+
"react/error-boundaries"?: RuleNoConfig;
|
|
1243
1257
|
"react/exhaustive-deps"?: RuleNoConfig | [AllowWarnDeny, ExhaustiveDepsConfig];
|
|
1258
|
+
"react/exhaustive-effect-dependencies"?: RuleNoConfig;
|
|
1244
1259
|
"react/forbid-component-props"?: RuleNoConfig | [AllowWarnDeny, ForbidComponentPropsConfig];
|
|
1245
1260
|
"react/forbid-dom-props"?: RuleNoConfig | [AllowWarnDeny, ForbidDomPropsConfig];
|
|
1246
1261
|
"react/forbid-elements"?: RuleNoConfig | [AllowWarnDeny, ForbidElementsConfig];
|
|
1247
1262
|
"react/forward-ref-uses-ref"?: RuleNoConfig;
|
|
1248
1263
|
"react/function-component-definition"?: RuleNoConfig | [AllowWarnDeny, FunctionComponentDefinitionConfig];
|
|
1264
|
+
"react/globals"?: RuleNoConfig;
|
|
1249
1265
|
"react/hook-use-state"?: RuleNoConfig | [AllowWarnDeny, HookUseStateConfig];
|
|
1266
|
+
"react/hooks"?: RuleNoConfig;
|
|
1250
1267
|
"react/iframe-missing-sandbox"?: RuleNoConfig;
|
|
1268
|
+
"react/immutability"?: RuleNoConfig;
|
|
1269
|
+
"react/incompatible-library"?: RuleNoConfig;
|
|
1270
|
+
"react/invariant"?: RuleNoConfig;
|
|
1251
1271
|
"react/jsx-boolean-value"?: RuleNoConfig | [AllowWarnDeny, EnforceBooleanAttribute] | [AllowWarnDeny, EnforceBooleanAttribute, JsxBooleanValueOptions];
|
|
1252
1272
|
"react/jsx-curly-brace-presence"?: RuleNoConfig | [AllowWarnDeny, JsxCurlyBracePresenceConfig];
|
|
1253
1273
|
"react/jsx-filename-extension"?: RuleNoConfig | [AllowWarnDeny, JsxFilenameExtensionConfig];
|
|
@@ -1266,11 +1286,13 @@ interface DummyRuleMap {
|
|
|
1266
1286
|
"react/jsx-pascal-case"?: RuleNoConfig | [AllowWarnDeny, JsxPascalCaseConfig];
|
|
1267
1287
|
"react/jsx-props-no-spread-multi"?: RuleNoConfig;
|
|
1268
1288
|
"react/jsx-props-no-spreading"?: RuleNoConfig | [AllowWarnDeny, JsxPropsNoSpreadingConfig];
|
|
1289
|
+
"react/memo-dependencies"?: RuleNoConfig;
|
|
1269
1290
|
"react/no-array-index-key"?: RuleNoConfig;
|
|
1270
1291
|
"react/no-children-prop"?: RuleNoConfig;
|
|
1271
1292
|
"react/no-clone-element"?: RuleNoConfig;
|
|
1272
1293
|
"react/no-danger"?: RuleNoConfig;
|
|
1273
1294
|
"react/no-danger-with-children"?: RuleNoConfig;
|
|
1295
|
+
"react/no-deriving-state-in-effects"?: RuleNoConfig;
|
|
1274
1296
|
"react/no-did-mount-set-state"?: RuleNoConfig | [AllowWarnDeny, AllowedOrDisallowInFunc];
|
|
1275
1297
|
"react/no-did-update-set-state"?: RuleNoConfig | [AllowWarnDeny, AllowedOrDisallowInFunc];
|
|
1276
1298
|
"react/no-direct-mutation-state"?: RuleNoConfig;
|
|
@@ -1293,14 +1315,25 @@ interface DummyRuleMap {
|
|
|
1293
1315
|
"react/only-export-components"?: RuleNoConfig | [AllowWarnDeny, OnlyExportComponentsConfig];
|
|
1294
1316
|
"react/prefer-es6-class"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever];
|
|
1295
1317
|
"react/prefer-function-component"?: RuleNoConfig | [AllowWarnDeny, PreferFunctionComponent];
|
|
1296
|
-
"react/
|
|
1318
|
+
"react/preserve-manual-memoization"?: RuleNoConfig;
|
|
1319
|
+
"react/purity"?: RuleNoConfig;
|
|
1297
1320
|
"react/react-in-jsx-scope"?: RuleNoConfig;
|
|
1321
|
+
"react/refs"?: RuleNoConfig;
|
|
1298
1322
|
"react/require-render-return"?: RuleNoConfig;
|
|
1323
|
+
"react/rule-suppression"?: RuleNoConfig;
|
|
1299
1324
|
"react/rules-of-hooks"?: RuleNoConfig;
|
|
1300
1325
|
"react/self-closing-comp"?: RuleNoConfig | [AllowWarnDeny, SelfClosingComp];
|
|
1326
|
+
"react/set-state-in-effect"?: RuleNoConfig;
|
|
1327
|
+
"react/set-state-in-render"?: RuleNoConfig;
|
|
1301
1328
|
"react/state-in-constructor"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever];
|
|
1329
|
+
"react/static-components"?: RuleNoConfig;
|
|
1302
1330
|
"react/style-prop-object"?: RuleNoConfig | [AllowWarnDeny, StylePropObjectConfig];
|
|
1331
|
+
"react/syntax"?: RuleNoConfig;
|
|
1332
|
+
"react/todo"?: RuleNoConfig;
|
|
1333
|
+
"react/unsupported-syntax"?: RuleNoConfig;
|
|
1334
|
+
"react/use-memo"?: RuleNoConfig;
|
|
1303
1335
|
"react/void-dom-elements-no-children"?: RuleNoConfig;
|
|
1336
|
+
"react/void-use-memo"?: RuleNoConfig;
|
|
1304
1337
|
"require-await"?: RuleNoConfig;
|
|
1305
1338
|
"require-unicode-regexp"?: RuleNoConfig | [AllowWarnDeny, RequireUnicodeRegexpConfig];
|
|
1306
1339
|
"require-yield"?: RuleNoConfig;
|
|
@@ -2278,7 +2311,8 @@ interface NoHooksConfig {
|
|
|
2278
2311
|
interface NoLargeSnapshotsConfig {
|
|
2279
2312
|
/**
|
|
2280
2313
|
* A map of snapshot file paths to arrays of snapshot names that are allowed to exceed the size limit.
|
|
2281
|
-
*
|
|
2314
|
+
* Each snapshot name is interpreted as a Rust regular expression. If it is not a valid regular
|
|
2315
|
+
* expression, it is matched as an exact literal string instead.
|
|
2282
2316
|
*/
|
|
2283
2317
|
allowedSnapshots?: {
|
|
2284
2318
|
[k: string]: string[] | undefined;
|
|
@@ -2470,6 +2504,12 @@ interface EmptyTagsConfig {
|
|
|
2470
2504
|
*/
|
|
2471
2505
|
tags?: string[];
|
|
2472
2506
|
}
|
|
2507
|
+
interface NoBlankBlocks {
|
|
2508
|
+
/**
|
|
2509
|
+
* Whether to automatically remove blank JSDoc blocks.
|
|
2510
|
+
*/
|
|
2511
|
+
enableFixer?: boolean;
|
|
2512
|
+
}
|
|
2473
2513
|
interface NoDefaultsConfig {
|
|
2474
2514
|
/**
|
|
2475
2515
|
* If true, report the presence of optional param names (square brackets) on `@param` tags.
|
|
@@ -2612,6 +2652,12 @@ interface AnchorAmbiguousTextConfig {
|
|
|
2612
2652
|
*/
|
|
2613
2653
|
words?: string[];
|
|
2614
2654
|
}
|
|
2655
|
+
interface AnchorHasContentConfig {
|
|
2656
|
+
/**
|
|
2657
|
+
* Additional custom component names to treat as anchor elements.
|
|
2658
|
+
*/
|
|
2659
|
+
components?: string[];
|
|
2660
|
+
}
|
|
2615
2661
|
interface AnchorIsValidConfig {
|
|
2616
2662
|
/**
|
|
2617
2663
|
* Sub-rule aspects to run.
|
|
@@ -3742,10 +3788,10 @@ interface NoUnusedVarsOptions {
|
|
|
3742
3788
|
* Specifies exceptions to this rule for unused arguments. Arguments whose
|
|
3743
3789
|
* names match this pattern will be ignored.
|
|
3744
3790
|
*
|
|
3745
|
-
* By default,
|
|
3746
|
-
*
|
|
3747
|
-
* behavior deviates from both ESLint and
|
|
3748
|
-
* provide a default pattern.
|
|
3791
|
+
* By default, names starting with `_` are ignored, except for the bare `_`
|
|
3792
|
+
* parameter. If options are configured with an object, this will default
|
|
3793
|
+
* to [`None`]. Note that this behavior deviates from both ESLint and
|
|
3794
|
+
* TypeScript-ESLint, which never provide a default pattern.
|
|
3749
3795
|
*
|
|
3750
3796
|
* #### Example
|
|
3751
3797
|
*
|
|
@@ -4125,6 +4171,46 @@ interface ObjectShorthandOptions {
|
|
|
4125
4171
|
ignoreConstructors?: boolean;
|
|
4126
4172
|
methodsIgnorePattern?: string;
|
|
4127
4173
|
}
|
|
4174
|
+
/**
|
|
4175
|
+
* Options for configuring declaration grouping by kind or initialization state.
|
|
4176
|
+
*
|
|
4177
|
+
* `initialized` and `uninitialized` take precedence over the per-kind option for the
|
|
4178
|
+
* corresponding declarators.
|
|
4179
|
+
*/
|
|
4180
|
+
interface OneVarOptions {
|
|
4181
|
+
/**
|
|
4182
|
+
* Controls grouping for `await using` declarations.
|
|
4183
|
+
*/
|
|
4184
|
+
awaitUsing?: OneVarMode;
|
|
4185
|
+
/**
|
|
4186
|
+
* Controls grouping for `const` declarations.
|
|
4187
|
+
*/
|
|
4188
|
+
const?: OneVarMode;
|
|
4189
|
+
/**
|
|
4190
|
+
* Controls grouping for initialized declarators, overriding per-kind options.
|
|
4191
|
+
*/
|
|
4192
|
+
initialized?: OneVarMode;
|
|
4193
|
+
/**
|
|
4194
|
+
* Controls grouping for `let` declarations.
|
|
4195
|
+
*/
|
|
4196
|
+
let?: OneVarMode;
|
|
4197
|
+
/**
|
|
4198
|
+
* Keeps direct `require(...)` initializers separate from other initialized declarations.
|
|
4199
|
+
*/
|
|
4200
|
+
separateRequires?: boolean;
|
|
4201
|
+
/**
|
|
4202
|
+
* Controls grouping for uninitialized declarators, overriding per-kind options.
|
|
4203
|
+
*/
|
|
4204
|
+
uninitialized?: OneVarMode;
|
|
4205
|
+
/**
|
|
4206
|
+
* Controls grouping for `using` declarations.
|
|
4207
|
+
*/
|
|
4208
|
+
using?: OneVarMode;
|
|
4209
|
+
/**
|
|
4210
|
+
* Controls grouping for `var` declarations.
|
|
4211
|
+
*/
|
|
4212
|
+
var?: OneVarMode;
|
|
4213
|
+
}
|
|
4128
4214
|
interface NoAsyncEndpointHandlersConfig {
|
|
4129
4215
|
/**
|
|
4130
4216
|
* An array of names that are allowed to be async.
|
|
@@ -4957,15 +5043,6 @@ interface PreferFunctionComponent {
|
|
|
4957
5043
|
*/
|
|
4958
5044
|
allowJsxUtilityClass?: boolean;
|
|
4959
5045
|
}
|
|
4960
|
-
interface ReactCompilerConfig {
|
|
4961
|
-
/**
|
|
4962
|
-
* Also report compiler bail-outs — places where React Compiler skipped a
|
|
4963
|
-
* component or hook (for example because of unsupported syntax) without
|
|
4964
|
-
* finding a rule violation. These do not indicate incorrect code, only
|
|
4965
|
-
* code that the compiler declined to optimize.
|
|
4966
|
-
*/
|
|
4967
|
-
reportAllBailouts?: boolean;
|
|
4968
|
-
}
|
|
4969
5046
|
interface SelfClosingComp {
|
|
4970
5047
|
/**
|
|
4971
5048
|
* Whether to enforce self-closing for custom components.
|
|
@@ -5121,6 +5198,9 @@ interface BanTsCommentConfig {
|
|
|
5121
5198
|
*/
|
|
5122
5199
|
"ts-nocheck"?: DirectiveConfigSchema;
|
|
5123
5200
|
}
|
|
5201
|
+
interface DescriptionFormatConfig {
|
|
5202
|
+
descriptionFormat?: string;
|
|
5203
|
+
}
|
|
5124
5204
|
interface ConsistentReturnConfig {
|
|
5125
5205
|
/**
|
|
5126
5206
|
* Treat explicit `return undefined` as equivalent to an unspecified return.
|
package/dist/src/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as main } from "../src-
|
|
1
|
+
import { t as main } from "../src-NHsLuNLs.mjs";
|
|
2
2
|
export { main as default };
|
|
@@ -573,6 +573,7 @@ const styleRules = [
|
|
|
573
573
|
"no-ternary",
|
|
574
574
|
"no-useless-computed-key",
|
|
575
575
|
"object-shorthand",
|
|
576
|
+
"one-var",
|
|
576
577
|
"operator-assignment",
|
|
577
578
|
"prefer-arrow-callback",
|
|
578
579
|
"prefer-const",
|
|
@@ -649,6 +650,7 @@ const styleRules = [
|
|
|
649
650
|
"jest/prefer-todo",
|
|
650
651
|
"jest/require-hook",
|
|
651
652
|
"jest/require-top-level-describe",
|
|
653
|
+
"jsdoc/no-blank-blocks",
|
|
652
654
|
"jsdoc/require-throws-description",
|
|
653
655
|
"jsdoc/require-yields-description",
|
|
654
656
|
"node/callback-return",
|
|
@@ -844,9 +846,13 @@ const suspiciousRules = [
|
|
|
844
846
|
"promise/always-return",
|
|
845
847
|
"promise/no-multiple-resolved",
|
|
846
848
|
"promise/no-promise-in-callback",
|
|
849
|
+
"react/capitalized-calls",
|
|
850
|
+
"react/exhaustive-effect-dependencies",
|
|
851
|
+
"react/hooks",
|
|
847
852
|
"react/iframe-missing-sandbox",
|
|
848
853
|
"react/jsx-no-comment-textnodes",
|
|
849
854
|
"react/jsx-no-script-url",
|
|
855
|
+
"react/memo-dependencies",
|
|
850
856
|
"react/no-namespace",
|
|
851
857
|
"react/no-unstable-nested-components",
|
|
852
858
|
"react/react-in-jsx-scope",
|
|
@@ -927,6 +933,7 @@ const restrictionRules = [
|
|
|
927
933
|
"react/forbid-component-props",
|
|
928
934
|
"react/forbid-dom-props",
|
|
929
935
|
"react/forbid-elements",
|
|
936
|
+
"react/invariant",
|
|
930
937
|
"react/jsx-filename-extension",
|
|
931
938
|
"react/jsx-no-literals",
|
|
932
939
|
"react/no-clone-element",
|
|
@@ -936,6 +943,10 @@ const restrictionRules = [
|
|
|
936
943
|
"react/no-unknown-property",
|
|
937
944
|
"react/only-export-components",
|
|
938
945
|
"react/prefer-function-component",
|
|
946
|
+
"react/rule-suppression",
|
|
947
|
+
"react/syntax",
|
|
948
|
+
"react/todo",
|
|
949
|
+
"react/unsupported-syntax",
|
|
939
950
|
"typescript/explicit-function-return-type",
|
|
940
951
|
"typescript/explicit-member-accessibility",
|
|
941
952
|
"typescript/explicit-module-boundary-types",
|
|
@@ -1117,8 +1128,12 @@ const correctnessRules = [
|
|
|
1117
1128
|
"promise/no-callback-in-promise",
|
|
1118
1129
|
"promise/no-new-statics",
|
|
1119
1130
|
"promise/valid-params",
|
|
1131
|
+
"react/error-boundaries",
|
|
1120
1132
|
"react/exhaustive-deps",
|
|
1121
1133
|
"react/forward-ref-uses-ref",
|
|
1134
|
+
"react/globals",
|
|
1135
|
+
"react/immutability",
|
|
1136
|
+
"react/incompatible-library",
|
|
1122
1137
|
"react/jsx-key",
|
|
1123
1138
|
"react/jsx-no-duplicate-props",
|
|
1124
1139
|
"react/jsx-no-undef",
|
|
@@ -1135,7 +1150,15 @@ const correctnessRules = [
|
|
|
1135
1150
|
"react/no-this-in-sfc",
|
|
1136
1151
|
"react/no-unsafe",
|
|
1137
1152
|
"react/no-will-update-set-state",
|
|
1153
|
+
"react/preserve-manual-memoization",
|
|
1154
|
+
"react/purity",
|
|
1155
|
+
"react/refs",
|
|
1156
|
+
"react/set-state-in-effect",
|
|
1157
|
+
"react/set-state-in-render",
|
|
1158
|
+
"react/static-components",
|
|
1159
|
+
"react/use-memo",
|
|
1138
1160
|
"react/void-dom-elements-no-children",
|
|
1161
|
+
"react/void-use-memo",
|
|
1139
1162
|
"typescript/await-thenable",
|
|
1140
1163
|
"typescript/no-array-delete",
|
|
1141
1164
|
"typescript/no-base-to-string",
|
|
@@ -1234,6 +1257,7 @@ const perfRules = [
|
|
|
1234
1257
|
"no-useless-call",
|
|
1235
1258
|
"react/jsx-no-constructed-context-values",
|
|
1236
1259
|
"react/no-array-index-key",
|
|
1260
|
+
"react/no-deriving-state-in-effects",
|
|
1237
1261
|
"react/no-object-type-as-default-prop",
|
|
1238
1262
|
"react-perf/jsx-no-jsx-as-prop",
|
|
1239
1263
|
"react-perf/jsx-no-new-array-as-prop",
|
|
@@ -1251,7 +1275,6 @@ const nurseryRules = [
|
|
|
1251
1275
|
"import/export",
|
|
1252
1276
|
"import/named",
|
|
1253
1277
|
"promise/no-return-in-finally",
|
|
1254
|
-
"react/react-compiler",
|
|
1255
1278
|
"react/require-render-return",
|
|
1256
1279
|
"typescript/no-unnecessary-condition",
|
|
1257
1280
|
"typescript/prefer-optional-chain",
|
|
@@ -1351,6 +1374,8 @@ var unsupportedRules = {
|
|
|
1351
1374
|
"unicorn/prefer-math-constants": "No need to implement, already covered by `oxc/approx-constant`.",
|
|
1352
1375
|
"unicorn/no-invalid-character-comparison": "No need to implement, already covered by `oxc/bad-char-at-comparison`.",
|
|
1353
1376
|
"unicorn/require-array-sort-compare": "No need to implement, already implemented by `typescript/require-array-sort-compare` via tsgolint.",
|
|
1377
|
+
"unicorn/no-barrel-files": "No need to implement separately; similar functionality is available via `oxc/no-barrel-file`",
|
|
1378
|
+
"unicorn/no-useless-concat": "No need to implement separately; `eslint/no-useless-concat` already covers the diagnostics and will implement the suggestion fixer.",
|
|
1354
1379
|
"eslint/no-negated-in-lhs": "Replaced by `eslint/no-unsafe-negation`, which we support.",
|
|
1355
1380
|
"eslint/no-catch-shadow": "Replaced by `eslint/no-shadow`.",
|
|
1356
1381
|
"eslint/id-blacklist": "Replaced by `eslint/id-denylist`.",
|
|
@@ -1436,35 +1461,13 @@ var unsupportedRules = {
|
|
|
1436
1461
|
"react/jsx-sort-props": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1437
1462
|
"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.",
|
|
1438
1463
|
"react/no-deprecated": "No need to implement, already implemented by `typescript/no-deprecated` via tsgolint.",
|
|
1439
|
-
"react/config": "
|
|
1440
|
-
"react/
|
|
1441
|
-
"react/component-hook-factories": "
|
|
1442
|
-
"react/
|
|
1443
|
-
"react/
|
|
1444
|
-
"react/
|
|
1445
|
-
"react/
|
|
1446
|
-
"react/purity": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1447
|
-
"react/refs": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1448
|
-
"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.",
|
|
1449
|
-
"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.",
|
|
1450
|
-
"react/static-components": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1451
|
-
"react/unsupported-syntax": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1452
|
-
"react/use-memo": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1453
|
-
"react/incompatible-library": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1454
|
-
"react/automatic-effect-dependencies": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1455
|
-
"react/memo-dependencies": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1456
|
-
"react/exhaustive-effect-dependencies": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1457
|
-
"react/capitalized-calls": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1458
|
-
"react/fbt": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1459
|
-
"react/fire": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1460
|
-
"react/invariant": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1461
|
-
"react/hooks": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1462
|
-
"react/memoized-effect-dependencies": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1463
|
-
"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.",
|
|
1464
|
-
"react/rule-suppression": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1465
|
-
"react/syntax": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1466
|
-
"react/todo": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1467
|
-
"react/void-use-memo": "React Compiler rules are implemented experimentally as `react/react-compiler`. We will split them into separate rules once they stabilize.",
|
|
1464
|
+
"react/config": "Oxlint uses fixed, valid React Compiler options; add this rule when compiler options become configurable.",
|
|
1465
|
+
"react/gating": "Oxlint does not expose React Compiler gating options; add this rule when compiler options become configurable.",
|
|
1466
|
+
"react/component-hook-factories": "Deprecated upstream in eslint-plugin-react-hooks 7.1; its checks were folded into `react/static-components`.",
|
|
1467
|
+
"react/automatic-effect-dependencies": "Removed upstream before eslint-plugin-react-hooks 7.1 (feature-flag cleanup).",
|
|
1468
|
+
"react/fire": "Removed upstream before eslint-plugin-react-hooks 7.1 (feature-flag cleanup).",
|
|
1469
|
+
"react/fbt": "Meta-internal FBT category; not implemented in oxc's Rust React Compiler port.",
|
|
1470
|
+
"react/memoized-effect-dependencies": "Upstream `EffectDependencies` category is not implemented in oxc's Rust React Compiler port.",
|
|
1468
1471
|
"react/default-props-match-prop-types": "This rule only applies to legacy class components, which are not widely used in modern React. Also stylistic.",
|
|
1469
1472
|
"react/forbid-foreign-prop-types": "PropTypes are ignored in React 19, and this rule is only relevant for very specific use-cases involving it.",
|
|
1470
1473
|
"react/forbid-prop-types": "PropTypes are ignored in React 19, and this rule is only relevant if you use the PropTypes package.",
|
|
@@ -2372,20 +2375,22 @@ const KEY_ORDER = [
|
|
|
2372
2375
|
"overrides"
|
|
2373
2376
|
];
|
|
2374
2377
|
const buildConfig = (configs, oxlintConfig, options) => {
|
|
2375
|
-
if (oxlintConfig === void 0)
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2378
|
+
if (oxlintConfig === void 0) {
|
|
2379
|
+
if (options?.merge) oxlintConfig = {
|
|
2380
|
+
plugins: [
|
|
2381
|
+
"oxc",
|
|
2382
|
+
"typescript",
|
|
2383
|
+
"unicorn",
|
|
2384
|
+
"react"
|
|
2385
|
+
],
|
|
2386
|
+
categories: { correctness: "warn" }
|
|
2387
|
+
};
|
|
2388
|
+
else oxlintConfig = {
|
|
2389
|
+
$schema: "./node_modules/oxlint/configuration_schema.json",
|
|
2390
|
+
plugins: [],
|
|
2391
|
+
categories: { correctness: "off" }
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2389
2394
|
if (oxlintConfig.$schema === void 0 && options?.merge) oxlintConfig.$schema = "./node_modules/oxlint/configuration_schema.json";
|
|
2390
2395
|
if (oxlintConfig.env?.builtin === void 0) {
|
|
2391
2396
|
if (oxlintConfig.env === void 0) oxlintConfig.env = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxlint/migrate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.79.0",
|
|
4
4
|
"description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"commander": "^15.0.0",
|
|
31
31
|
"globals": "^17.0.0",
|
|
32
|
-
"oxc-parser": "^0.
|
|
32
|
+
"oxc-parser": "^0.144.0",
|
|
33
33
|
"tinyglobby": "^0.2.14"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@antfu/eslint-config": "^9.0.0",
|
|
37
37
|
"@babel/eslint-plugin": "^8.0.0",
|
|
38
|
-
"@e18e/eslint-plugin": "^0.
|
|
38
|
+
"@e18e/eslint-plugin": "^0.8.0",
|
|
39
39
|
"@eslint-react/eslint-plugin": "^5.0.0",
|
|
40
40
|
"@eslint/js": "^10.0.0",
|
|
41
41
|
"@logux/eslint-config": "^57.0.0",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"husky": "^9.1.7",
|
|
73
73
|
"lint-staged": "^17.0.0",
|
|
74
74
|
"next": "^16.0.0",
|
|
75
|
-
"oxfmt": "^0.
|
|
76
|
-
"oxlint": "^1.
|
|
77
|
-
"oxlint-tsgolint": "^0.
|
|
75
|
+
"oxfmt": "^0.63.0",
|
|
76
|
+
"oxlint": "^1.79.0",
|
|
77
|
+
"oxlint-tsgolint": "^0.25.0",
|
|
78
78
|
"tsdown": "^0.22.0",
|
|
79
79
|
"typescript": "^6.0.0",
|
|
80
80
|
"typescript-eslint": "^8.35.0",
|