biome-to-oxc 1.3.2 → 1.3.7
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as readJsonFile, n as DefaultReporter, r as findClosestPackageJson, t as migrate } from "../src-
|
|
2
|
+
import { i as readJsonFile, n as DefaultReporter, r as findClosestPackageJson, t as migrate } from "../src-BerrlO1u.mjs";
|
|
3
3
|
import { realpath } from "node:fs/promises";
|
|
4
4
|
import { dirname } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
package/dist/src/index.d.mts
CHANGED
|
@@ -223,6 +223,19 @@ interface OxfmtConfig {
|
|
|
223
223
|
htmlWhitespaceSensitivity?: 'css' | 'strict' | 'ignore';
|
|
224
224
|
proseWrap?: 'always' | 'never' | 'preserve';
|
|
225
225
|
vueIndentScriptAndStyle?: boolean;
|
|
226
|
+
jsdoc?: boolean | {
|
|
227
|
+
addDefaultToDescription?: boolean;
|
|
228
|
+
bracketSpacing?: boolean;
|
|
229
|
+
capitalizeDescriptions?: boolean;
|
|
230
|
+
commentLineStrategy?: 'singleLine' | 'multiline' | 'keep';
|
|
231
|
+
descriptionTag?: boolean;
|
|
232
|
+
descriptionWithDot?: boolean;
|
|
233
|
+
keepUnparsableExampleIndent?: boolean;
|
|
234
|
+
lineWrappingStyle?: 'greedy' | 'balance';
|
|
235
|
+
preferCodeFences?: boolean;
|
|
236
|
+
separateReturnsFromParam?: boolean;
|
|
237
|
+
separateTagGroups?: boolean;
|
|
238
|
+
};
|
|
226
239
|
svelte?: boolean | {
|
|
227
240
|
allowShorthand?: boolean;
|
|
228
241
|
indentScriptAndStyle?: boolean;
|
package/dist/src/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as migrate } from "../src-
|
|
1
|
+
import { t as migrate } from "../src-BerrlO1u.mjs";
|
|
2
2
|
export { migrate };
|
|
@@ -553,6 +553,7 @@ const EXPLICIT_OXFMT_OPTION_KEYS$1 = [
|
|
|
553
553
|
"htmlWhitespaceSensitivity",
|
|
554
554
|
"proseWrap",
|
|
555
555
|
"vueIndentScriptAndStyle",
|
|
556
|
+
"jsdoc",
|
|
556
557
|
"sortImports",
|
|
557
558
|
"sortPackageJson",
|
|
558
559
|
"sortTailwindcss",
|
|
@@ -631,7 +632,7 @@ function applyExplicitFormatterOptionPassThrough$1(sources, oxfmtConfig) {
|
|
|
631
632
|
}
|
|
632
633
|
//#endregion
|
|
633
634
|
//#region src/js-plugin-scaffolder.ts
|
|
634
|
-
const RESERVED_JS_PLUGIN_NAMES = new Set([
|
|
635
|
+
const RESERVED_JS_PLUGIN_NAMES = /* @__PURE__ */ new Set([
|
|
635
636
|
"react",
|
|
636
637
|
"unicorn",
|
|
637
638
|
"typescript",
|
|
@@ -775,6 +776,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
775
776
|
noConstantCondition: "no-constant-condition",
|
|
776
777
|
noConstantMathMinMaxClamp: "oxc/bad-min-max-func",
|
|
777
778
|
noConstructorReturn: "no-constructor-return",
|
|
779
|
+
noContinue: "no-continue",
|
|
778
780
|
noControlCharactersInRegex: "no-control-regex",
|
|
779
781
|
noDangerouslySetInnerHtml: "react/no-danger",
|
|
780
782
|
noDangerouslySetInnerHtmlWithChildren: "react/no-danger-with-children",
|
|
@@ -812,6 +814,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
812
814
|
noHeaderScope: "jsx-a11y/scope",
|
|
813
815
|
noHeadElement: "nextjs/no-head-element",
|
|
814
816
|
noHeadImportInDocument: "nextjs/no-head-import-in-document",
|
|
817
|
+
noImgElement: "nextjs/no-img-element",
|
|
815
818
|
noImportAssign: "no-import-assign",
|
|
816
819
|
noImportCycles: "import/no-cycle",
|
|
817
820
|
noImplicitCoercions: "no-implicit-coercion",
|
|
@@ -825,6 +828,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
825
828
|
noIrregularWhitespace: "no-irregular-whitespace",
|
|
826
829
|
noInteractiveElementToNoninteractiveRole: "jsx-a11y/no-interactive-element-to-noninteractive-role",
|
|
827
830
|
noInvalidNewBuiltin: "no-new-native-nonconstructor",
|
|
831
|
+
noJsxLiterals: "react/jsx-no-literals",
|
|
828
832
|
noJsxNamespace: "react/no-namespace",
|
|
829
833
|
noLabelWithoutControl: "jsx-a11y/label-has-associated-control",
|
|
830
834
|
noLabelVar: "no-label-var",
|
|
@@ -886,6 +890,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
886
890
|
noUnknownProperty: "react/no-unknown-property",
|
|
887
891
|
noUnassignedVariables: "no-unassigned-vars",
|
|
888
892
|
noUselessThisAlias: "typescript/no-this-alias",
|
|
893
|
+
noUnusedExpressions: "no-unused-expressions",
|
|
889
894
|
noUnusedFunctionParameters: "no-unused-vars",
|
|
890
895
|
noUnusedImports: "no-unused-vars",
|
|
891
896
|
noUnnecessaryContinue: "no-continue",
|
|
@@ -900,6 +905,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
900
905
|
noUnusedLabels: "no-unused-labels",
|
|
901
906
|
noUnusedPrivateClassMembers: "no-unused-private-class-members",
|
|
902
907
|
noUnusedVariables: "no-unused-vars",
|
|
908
|
+
noUnwantedPolyfillio: "nextjs/no-unwanted-polyfillio",
|
|
903
909
|
noUselessCatch: "no-useless-catch",
|
|
904
910
|
noUselessConstructor: "no-useless-constructor",
|
|
905
911
|
noUselessEmptyExport: "typescript/no-useless-empty-export",
|
|
@@ -917,6 +923,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
917
923
|
noVoidElementsWithChildren: "react/void-dom-elements-no-children",
|
|
918
924
|
noVoidTypeReturn: "typescript/no-invalid-void-type",
|
|
919
925
|
noVueDataObjectDeclaration: ["vue/no-deprecated-data-object-declaration", "vue/no-shared-component-data"],
|
|
926
|
+
noVueDuplicateKeys: "vue/no-dupe-keys",
|
|
920
927
|
noVueReservedKeys: "vue/no-reserved-keys",
|
|
921
928
|
noVueReservedProps: "vue/no-reserved-props",
|
|
922
929
|
noWith: "no-with",
|
|
@@ -1045,13 +1052,24 @@ function normalizeOxlintRuleName(ruleName) {
|
|
|
1045
1052
|
}
|
|
1046
1053
|
function mapBiomeRuleOptionsToOxlintSeverity(biomeName, severity, biomeSeverity) {
|
|
1047
1054
|
if (biomeName === "useVueNextTickPromise") return typeof severity === "string" ? [severity, "promise"] : severity;
|
|
1048
|
-
if (
|
|
1055
|
+
if (typeof severity !== "string") return severity;
|
|
1049
1056
|
if (typeof biomeSeverity !== "object" || biomeSeverity === null) return severity;
|
|
1050
1057
|
const { options } = biomeSeverity;
|
|
1051
1058
|
if (typeof options !== "object" || options === null || Array.isArray(options)) return severity;
|
|
1059
|
+
if (biomeName === "noJsxLiterals") {
|
|
1060
|
+
const { allowedStrings, ignoreProps, noStrings } = options;
|
|
1061
|
+
const oxlintOptions = {};
|
|
1062
|
+
if (Array.isArray(allowedStrings) && allowedStrings.every((value) => typeof value === "string")) oxlintOptions.allowedStrings = allowedStrings;
|
|
1063
|
+
if (typeof ignoreProps === "boolean") oxlintOptions.ignoreProps = ignoreProps;
|
|
1064
|
+
if (typeof noStrings === "boolean") {
|
|
1065
|
+
oxlintOptions.noStrings = noStrings;
|
|
1066
|
+
oxlintOptions.noAttributeStrings = noStrings;
|
|
1067
|
+
}
|
|
1068
|
+
return Object.keys(oxlintOptions).length > 0 ? [severity, oxlintOptions] : severity;
|
|
1069
|
+
}
|
|
1070
|
+
if (biomeName !== "useConsistentMethodSignatures") return severity;
|
|
1052
1071
|
const { style } = options;
|
|
1053
1072
|
if (style !== "method" && style !== "property") return severity;
|
|
1054
|
-
if (typeof severity !== "string") return severity;
|
|
1055
1073
|
return [severity, style];
|
|
1056
1074
|
}
|
|
1057
1075
|
function mapBiomeRuleSeverity(severity, reporter, biomeRuleName) {
|
|
@@ -1168,6 +1186,7 @@ const EXPLICIT_OXFMT_OPTION_KEYS = [
|
|
|
1168
1186
|
"htmlWhitespaceSensitivity",
|
|
1169
1187
|
"proseWrap",
|
|
1170
1188
|
"vueIndentScriptAndStyle",
|
|
1189
|
+
"jsdoc",
|
|
1171
1190
|
"sortImports",
|
|
1172
1191
|
"sortPackageJson",
|
|
1173
1192
|
"sortTailwindcss",
|
|
@@ -2166,7 +2185,7 @@ async function detectWorkspaceMonorepo(projectDir) {
|
|
|
2166
2185
|
}
|
|
2167
2186
|
}
|
|
2168
2187
|
async function cleanupLegacyBiomeFiles(outputDir, primaryBiomeConfigPath, dryRun, reporter, signal) {
|
|
2169
|
-
const candidates = new Set([primaryBiomeConfigPath, resolve(outputDir, ".biomeignore")]);
|
|
2188
|
+
const candidates = /* @__PURE__ */ new Set([primaryBiomeConfigPath, resolve(outputDir, ".biomeignore")]);
|
|
2170
2189
|
for (const configName of LEGACY_BIOME_CONFIG_NAMES) candidates.add(resolve(outputDir, configName));
|
|
2171
2190
|
const touchedPaths = [];
|
|
2172
2191
|
for (const candidatePath of candidates) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "biome-to-oxc",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"description": "Migrate from Biome to Oxc ecosystem (oxlint + oxfmt + oxlint-tsgolint)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"biome",
|
|
@@ -39,18 +39,19 @@
|
|
|
39
39
|
"zod": "^4.4.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/node": "^
|
|
43
|
-
"@
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"oxlint
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
42
|
+
"@types/node": "^26.1.1",
|
|
43
|
+
"@typescript/native-preview": "latest",
|
|
44
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
45
|
+
"oxfmt": "^0.58.0",
|
|
46
|
+
"oxlint": "^1.73.0",
|
|
47
|
+
"oxlint-tsgolint": "^0.24.0",
|
|
48
|
+
"tsdown": "^0.22.4",
|
|
49
|
+
"typescript": "7.0.2",
|
|
50
|
+
"vitest": "^4.1.10"
|
|
50
51
|
},
|
|
51
52
|
"engines": {
|
|
52
53
|
"node": ">=22.22.3",
|
|
53
|
-
"pnpm": ">=11.
|
|
54
|
+
"pnpm": ">=11.10.0"
|
|
54
55
|
},
|
|
55
56
|
"scripts": {
|
|
56
57
|
"test": "vitest",
|