biome-to-oxc 1.3.0 → 1.3.2
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-BfsedzGC.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.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as migrate } from "../src-
|
|
1
|
+
import { t as migrate } from "../src-BfsedzGC.mjs";
|
|
2
2
|
export { migrate };
|
|
@@ -743,16 +743,23 @@ const BIOME_TO_OXLINT_CATEGORY_MAP = {
|
|
|
743
743
|
nursery: "nursery"
|
|
744
744
|
};
|
|
745
745
|
const BIOME_TO_OXLINT_RULE_MAP = {
|
|
746
|
-
noAccessKey: "
|
|
746
|
+
noAccessKey: "jsx-a11y/no-access-key",
|
|
747
747
|
noArguments: "prefer-rest-params",
|
|
748
|
-
noAriaHiddenOnFocusable: "
|
|
748
|
+
noAriaHiddenOnFocusable: "jsx-a11y/no-aria-hidden-on-focusable",
|
|
749
|
+
noAriaUnsupportedElements: "jsx-a11y/aria-unsupported-elements",
|
|
749
750
|
noAccumulatingSpread: "oxc/no-accumulating-spread",
|
|
751
|
+
noAlert: "no-alert",
|
|
750
752
|
noConstantBinaryExpressions: "no-constant-binary-expression",
|
|
751
753
|
noApproximativeNumericConstant: "oxc/approx-constant",
|
|
752
754
|
noBarrelFile: "oxc/no-barrel-file",
|
|
753
755
|
noArrayIndexKey: "react/no-array-index-key",
|
|
754
756
|
noAssignInExpressions: "no-cond-assign",
|
|
755
757
|
noAsyncPromiseExecutor: "no-async-promise-executor",
|
|
758
|
+
noAutofocus: "jsx-a11y/no-autofocus",
|
|
759
|
+
noAwaitInLoops: "no-await-in-loop",
|
|
760
|
+
noBaseToString: "typescript/no-base-to-string",
|
|
761
|
+
noBeforeInteractiveScriptOutsideDocument: "nextjs/no-before-interactive-script-outside-document",
|
|
762
|
+
noBitwiseOperators: "no-bitwise",
|
|
756
763
|
noCatchAssign: "no-ex-assign",
|
|
757
764
|
noChildrenProp: "react/no-children-prop",
|
|
758
765
|
noClassAssign: "no-class-assign",
|
|
@@ -773,14 +780,22 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
773
780
|
noDangerouslySetInnerHtmlWithChildren: "react/no-danger-with-children",
|
|
774
781
|
noDebugger: "no-debugger",
|
|
775
782
|
noDefaultExport: "import/no-default-export",
|
|
783
|
+
noDistractingElements: "jsx-a11y/no-distracting-elements",
|
|
776
784
|
noDoubleEquals: "eqeqeq",
|
|
777
785
|
noDuplicateCase: "no-duplicate-case",
|
|
778
786
|
noDuplicateElseIf: "no-dupe-else-if",
|
|
779
787
|
noDuplicateClassMembers: "no-dupe-class-members",
|
|
788
|
+
noDuplicateEnumValues: "typescript/no-duplicate-enum-values",
|
|
780
789
|
noDuplicateJsxProps: "react/jsx-no-duplicate-props",
|
|
781
790
|
noDuplicateObjectKeys: "no-dupe-keys",
|
|
791
|
+
noDocumentCookie: "unicorn/no-document-cookie",
|
|
792
|
+
noDocumentImportInPage: "nextjs/no-document-import-in-page",
|
|
793
|
+
noDoneCallback: "jest/no-done-callback",
|
|
794
|
+
noDivRegex: "no-div-regex",
|
|
795
|
+
noEmptyBlock: "no-empty",
|
|
782
796
|
noEmptyBlockStatements: "no-empty",
|
|
783
797
|
noEmptyCharacterClassInRegex: "no-empty-character-class",
|
|
798
|
+
noEmptyInterface: "typescript/no-empty-interface",
|
|
784
799
|
noEmptyPattern: "no-empty-pattern",
|
|
785
800
|
noExcessiveCognitiveComplexity: "complexity",
|
|
786
801
|
noExplicitAny: "typescript/no-explicit-any",
|
|
@@ -791,32 +806,58 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
791
806
|
noFocusedTests: ["jest/no-focused-tests", "vitest/no-focused-tests"],
|
|
792
807
|
noForEach: "unicorn/no-array-for-each",
|
|
793
808
|
noFunctionAssign: "no-func-assign",
|
|
809
|
+
noGlobalAssign: "no-global-assign",
|
|
794
810
|
noGlobalEval: "no-eval",
|
|
795
811
|
noGlobalObjectCalls: "no-obj-calls",
|
|
812
|
+
noHeaderScope: "jsx-a11y/scope",
|
|
813
|
+
noHeadElement: "nextjs/no-head-element",
|
|
814
|
+
noHeadImportInDocument: "nextjs/no-head-import-in-document",
|
|
796
815
|
noImportAssign: "no-import-assign",
|
|
816
|
+
noImportCycles: "import/no-cycle",
|
|
817
|
+
noImplicitCoercions: "no-implicit-coercion",
|
|
797
818
|
noInnerDeclarations: "no-inner-declarations",
|
|
798
819
|
noImplicitBoolean: "no-implicit-coercion",
|
|
799
820
|
noImpliedEval: "no-implied-eval",
|
|
821
|
+
noInferrableTypes: "typescript/no-inferrable-types",
|
|
800
822
|
noInvalidBuiltinInstantiation: "no-new-native-nonconstructor",
|
|
801
823
|
noInvalidUseBeforeDeclaration: "no-use-before-define",
|
|
802
824
|
noInvalidConstructorSuper: "no-this-before-super",
|
|
803
|
-
|
|
825
|
+
noIrregularWhitespace: "no-irregular-whitespace",
|
|
826
|
+
noInteractiveElementToNoninteractiveRole: "jsx-a11y/no-interactive-element-to-noninteractive-role",
|
|
804
827
|
noInvalidNewBuiltin: "no-new-native-nonconstructor",
|
|
805
|
-
|
|
828
|
+
noJsxNamespace: "react/no-namespace",
|
|
829
|
+
noLabelWithoutControl: "jsx-a11y/label-has-associated-control",
|
|
806
830
|
noLabelVar: "no-label-var",
|
|
831
|
+
noLoopFunc: "no-loop-func",
|
|
832
|
+
noMagicNumbers: "no-magic-numbers",
|
|
807
833
|
noMisleadingCharacterClass: "no-misleading-character-class",
|
|
808
834
|
noMisleadingInstantiator: "typescript/no-misused-new",
|
|
835
|
+
noMisrefactoredShorthandAssign: "oxc/misrefactored-assign-op",
|
|
836
|
+
noMisusedPromises: "typescript/no-misused-promises",
|
|
837
|
+
noMultiAssign: "no-multi-assign",
|
|
838
|
+
noMultiStr: "no-multi-str",
|
|
809
839
|
noNewSymbol: "no-new-native-nonconstructor",
|
|
810
840
|
noNodejsModules: "import/no-nodejs-modules",
|
|
841
|
+
noNamespace: "typescript/no-namespace",
|
|
842
|
+
noNamespaceImport: "import/no-namespace",
|
|
811
843
|
noNestedComponentDefinitions: "react/no-unstable-nested-components",
|
|
812
|
-
|
|
813
|
-
|
|
844
|
+
noNestedTernary: "no-nested-ternary",
|
|
845
|
+
noNoninteractiveElementInteractions: "jsx-a11y/no-noninteractive-element-interactions",
|
|
846
|
+
noNoninteractiveElementToInteractiveRole: "jsx-a11y/no-noninteractive-element-to-interactive-role",
|
|
847
|
+
noNoninteractiveTabindex: "jsx-a11y/no-noninteractive-tabindex",
|
|
848
|
+
noNonNullAssertedOptionalChain: "typescript/no-non-null-asserted-optional-chain",
|
|
814
849
|
noNonNullAssertion: "typescript/no-non-null-assertion",
|
|
815
850
|
noNonoctalDecimalEscape: "no-nonoctal-decimal-escape",
|
|
851
|
+
noParametersOnlyUsedInRecursion: "oxc/only-used-in-recursion",
|
|
816
852
|
noParameterAssign: "no-param-reassign",
|
|
817
853
|
noParameterProperties: "typescript/parameter-properties",
|
|
854
|
+
noPrecisionLoss: "no-loss-of-precision",
|
|
855
|
+
noProcessEnv: "node/no-process-env",
|
|
856
|
+
noProto: "no-proto",
|
|
818
857
|
noPrototypeBuiltins: "no-prototype-builtins",
|
|
819
858
|
noRedeclare: "no-redeclare",
|
|
859
|
+
noRedundantAlt: "jsx-a11y/img-redundant-alt",
|
|
860
|
+
noRedundantRoles: "jsx-a11y/no-redundant-roles",
|
|
820
861
|
noDuplicateTestHooks: ["jest/no-duplicate-hooks", "vitest/no-duplicate-hooks"],
|
|
821
862
|
noConditionalExpect: ["jest/no-conditional-expect", "vitest/no-conditional-expect"],
|
|
822
863
|
noExcessiveNestedTestSuites: ["jest/max-nested-describe", "vitest/max-nested-describe"],
|
|
@@ -824,6 +865,10 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
824
865
|
noMisplacedAssertion: ["jest/no-standalone-expect", "vitest/no-standalone-expect"],
|
|
825
866
|
noRenderReturnValue: "react/no-render-return-value",
|
|
826
867
|
noRestrictedGlobals: "no-restricted-globals",
|
|
868
|
+
noRestrictedImports: "no-restricted-imports",
|
|
869
|
+
noRestrictedTypes: "typescript/no-restricted-types",
|
|
870
|
+
noReturnAssign: "no-return-assign",
|
|
871
|
+
noScriptUrl: "no-script-url",
|
|
827
872
|
noSelfCompare: "no-self-compare",
|
|
828
873
|
noSelfAssign: "no-self-assign",
|
|
829
874
|
noSetterReturn: "no-setter-return",
|
|
@@ -831,15 +876,21 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
831
876
|
noShadowRestrictedNames: "no-shadow-restricted-names",
|
|
832
877
|
noSkippedTests: ["jest/no-disabled-tests", "vitest/no-disabled-tests"],
|
|
833
878
|
noSparseArray: "no-sparse-arrays",
|
|
879
|
+
noStaticOnlyClass: "unicorn/no-static-only-class",
|
|
880
|
+
noSyncScripts: "nextjs/no-sync-scripts",
|
|
834
881
|
noSwitchDeclarations: "no-case-declarations",
|
|
835
|
-
noStaticElementInteractions: "
|
|
882
|
+
noStaticElementInteractions: "jsx-a11y/no-static-element-interactions",
|
|
883
|
+
noTemplateCurlyInString: "no-template-curly-in-string",
|
|
884
|
+
noTernary: "no-ternary",
|
|
836
885
|
noUndeclaredVariables: "no-undef",
|
|
837
886
|
noUnknownProperty: "react/no-unknown-property",
|
|
887
|
+
noUnassignedVariables: "no-unassigned-vars",
|
|
838
888
|
noUselessThisAlias: "typescript/no-this-alias",
|
|
839
889
|
noUnusedFunctionParameters: "no-unused-vars",
|
|
840
890
|
noUnusedImports: "no-unused-vars",
|
|
841
891
|
noUnnecessaryContinue: "no-continue",
|
|
842
892
|
noUnnecessaryConditions: "typescript/no-unnecessary-condition",
|
|
893
|
+
noUnnecessaryTemplateExpression: "typescript/no-unnecessary-template-expression",
|
|
843
894
|
noUnreachable: "no-unreachable",
|
|
844
895
|
noUnreachableSuper: "constructor-super",
|
|
845
896
|
noUnsafeDeclarationMerging: "typescript/no-unsafe-declaration-merging",
|
|
@@ -852,54 +903,126 @@ const BIOME_TO_OXLINT_RULE_MAP = {
|
|
|
852
903
|
noUselessCatch: "no-useless-catch",
|
|
853
904
|
noUselessConstructor: "no-useless-constructor",
|
|
854
905
|
noUselessEmptyExport: "typescript/no-useless-empty-export",
|
|
906
|
+
noUselessEscapeInString: "no-useless-escape",
|
|
855
907
|
noUselessFragments: "react/jsx-no-useless-fragment",
|
|
856
908
|
noUselessLabel: "no-extra-label",
|
|
857
909
|
noUselessRename: "no-useless-rename",
|
|
910
|
+
noUselessReturn: "no-useless-return",
|
|
858
911
|
noUselessTernary: "no-unneeded-ternary",
|
|
859
912
|
noUselessSwitchCase: "unicorn/no-useless-switch-case",
|
|
860
913
|
noUselessTypeConstraint: "typescript/no-unnecessary-type-constraint",
|
|
914
|
+
noUselessUndefined: "unicorn/no-useless-undefined",
|
|
915
|
+
noVoid: "no-void",
|
|
861
916
|
noVar: "no-var",
|
|
862
917
|
noVoidElementsWithChildren: "react/void-dom-elements-no-children",
|
|
863
918
|
noVoidTypeReturn: "typescript/no-invalid-void-type",
|
|
919
|
+
noVueDataObjectDeclaration: ["vue/no-deprecated-data-object-declaration", "vue/no-shared-component-data"],
|
|
920
|
+
noVueReservedKeys: "vue/no-reserved-keys",
|
|
921
|
+
noVueReservedProps: "vue/no-reserved-props",
|
|
864
922
|
noWith: "no-with",
|
|
865
|
-
|
|
923
|
+
noYodaExpression: "yoda",
|
|
924
|
+
useAltText: "jsx-a11y/alt-text",
|
|
925
|
+
useAnchorContent: "jsx-a11y/anchor-has-content",
|
|
866
926
|
useArrowFunction: "prefer-arrow-callback",
|
|
927
|
+
useArraySome: "unicorn/prefer-array-some",
|
|
928
|
+
useArraySortCompare: "typescript/require-array-sort-compare",
|
|
929
|
+
useAriaActivedescendantWithTabindex: "jsx-a11y/aria-activedescendant-has-tabindex",
|
|
867
930
|
useAwaitThenable: "typescript/await-thenable",
|
|
868
931
|
useButtonType: "react/button-has-type",
|
|
869
|
-
useAriaPropTypes: "
|
|
870
|
-
useAriaPropsForRole: "
|
|
932
|
+
useAriaPropTypes: "jsx-a11y/aria-proptypes",
|
|
933
|
+
useAriaPropsForRole: "jsx-a11y/role-has-required-aria-props",
|
|
934
|
+
useAriaPropsSupportedByRole: "jsx-a11y/role-supports-aria-props",
|
|
871
935
|
useAsConstAssertion: "typescript/prefer-as-const",
|
|
936
|
+
useAtIndex: "unicorn/prefer-at",
|
|
872
937
|
useAwait: "require-await",
|
|
938
|
+
useComponentExportOnlyModules: "react/only-export-components",
|
|
939
|
+
useConsistentArrayType: "typescript/array-type",
|
|
940
|
+
useConsistentCurlyBraces: "curly",
|
|
941
|
+
useConsistentMethodSignatures: "typescript/method-signature-style",
|
|
873
942
|
useConsistentMemberAccessibility: "typescript/explicit-member-accessibility",
|
|
874
943
|
useConsistentTestIt: ["jest/consistent-test-it", "vitest/consistent-test-it"],
|
|
875
944
|
useConst: "prefer-const",
|
|
945
|
+
useDateNow: "unicorn/prefer-date-now",
|
|
876
946
|
useDefaultParameterLast: "default-param-last",
|
|
947
|
+
useDefaultSwitchClause: "default-case",
|
|
948
|
+
useDefaultSwitchClauseLast: "default-case-last",
|
|
949
|
+
useDestructuring: "prefer-destructuring",
|
|
950
|
+
useDomNodeTextContent: "unicorn/prefer-dom-node-text-content",
|
|
951
|
+
useDomQuerySelector: "unicorn/prefer-query-selector",
|
|
952
|
+
useEnumInitializers: "typescript/prefer-enum-initializers",
|
|
953
|
+
useErrorMessage: "unicorn/error-message",
|
|
877
954
|
useExpect: ["jest/expect-expect", "vitest/expect-expect"],
|
|
955
|
+
useExplicitLengthCheck: "unicorn/explicit-length-check",
|
|
956
|
+
useExponentiationOperator: "prefer-exponentiation-operator",
|
|
957
|
+
useExportsLast: "import/exports-last",
|
|
878
958
|
useExportType: "typescript/consistent-type-exports",
|
|
879
959
|
useExhaustiveSwitchCases: "typescript/switch-exhaustiveness-check",
|
|
880
960
|
useExhaustiveDependencies: "react/exhaustive-deps",
|
|
881
961
|
useFilenamingConvention: "unicorn/filename-case",
|
|
882
|
-
|
|
883
|
-
|
|
962
|
+
useFind: "typescript/prefer-find",
|
|
963
|
+
useFlatMap: "unicorn/prefer-array-flat-map",
|
|
964
|
+
useFocusableInteractive: "jsx-a11y/interactive-supports-focus",
|
|
965
|
+
useForOf: "typescript/prefer-for-of",
|
|
966
|
+
useGetterReturn: "getter-return",
|
|
967
|
+
useGlobalThis: "unicorn/prefer-global-this",
|
|
968
|
+
useGoogleFontDisplay: "nextjs/google-font-display",
|
|
969
|
+
useGoogleFontPreconnect: "nextjs/google-font-preconnect",
|
|
970
|
+
useGuardForIn: "guard-for-in",
|
|
971
|
+
useHeadingContent: "jsx-a11y/heading-has-content",
|
|
972
|
+
useHtmlLang: "jsx-a11y/html-has-lang",
|
|
884
973
|
useHookAtTopLevel: "react/rules-of-hooks",
|
|
974
|
+
useIframeTitle: "jsx-a11y/iframe-has-title",
|
|
975
|
+
useImportsFirst: "import/first",
|
|
885
976
|
useImportType: "typescript/consistent-type-imports",
|
|
977
|
+
useIndexOf: "unicorn/prefer-array-index-of",
|
|
978
|
+
useInlineScriptId: "nextjs/inline-script-id",
|
|
979
|
+
useIterableCallbackReturn: "array-callback-return",
|
|
886
980
|
useIsNan: "use-isnan",
|
|
887
981
|
useJsxKeyInIterable: "react/jsx-key",
|
|
888
|
-
useKeyWithClickEvents: "
|
|
982
|
+
useKeyWithClickEvents: "jsx-a11y/click-events-have-key-events",
|
|
983
|
+
useKeyWithMouseEvents: "jsx-a11y/mouse-events-have-key-events",
|
|
984
|
+
useLiteralEnumMembers: "typescript/prefer-literal-enum-member",
|
|
889
985
|
useLiteralKeys: "typescript/dot-notation",
|
|
986
|
+
useMathMinMax: "unicorn/prefer-math-min-max",
|
|
987
|
+
useMediaCaption: "jsx-a11y/media-has-caption",
|
|
988
|
+
useNamedCaptureGroup: "prefer-named-capture-group",
|
|
890
989
|
useNodejsImportProtocol: "unicorn/prefer-node-protocol",
|
|
990
|
+
useNullishCoalescing: "typescript/prefer-nullish-coalescing",
|
|
991
|
+
useNumericLiterals: "prefer-numeric-literals",
|
|
992
|
+
useObjectSpread: "prefer-object-spread",
|
|
891
993
|
useOptionalChain: "typescript/prefer-optional-chain",
|
|
994
|
+
useParseIntRadix: "radix",
|
|
995
|
+
useReadonlyClassProperties: "typescript/prefer-readonly",
|
|
892
996
|
useReactFunctionComponents: "react/prefer-function-component",
|
|
997
|
+
useReduceTypeParameter: "typescript/prefer-reduce-type-parameter",
|
|
893
998
|
useRegexLiterals: "prefer-regex-literals",
|
|
894
|
-
|
|
999
|
+
useRegexpExec: "typescript/prefer-regexp-exec",
|
|
1000
|
+
useRegexpTest: "unicorn/prefer-regexp-test",
|
|
1001
|
+
useSemanticElements: "jsx-a11y/prefer-tag-over-role",
|
|
1002
|
+
useShorthandFunctionType: "typescript/prefer-function-type",
|
|
895
1003
|
useSimplifiedLogicExpression: "unicorn/prefer-logical-operator-over-ternary",
|
|
1004
|
+
useSpread: "prefer-spread",
|
|
1005
|
+
useStringStartsEndsWith: "typescript/prefer-string-starts-ends-with",
|
|
1006
|
+
useSymbolDescription: "symbol-description",
|
|
896
1007
|
useTemplate: "prefer-template",
|
|
1008
|
+
useTestHooksInOrder: ["jest/prefer-hooks-in-order", "vitest/prefer-hooks-in-order"],
|
|
897
1009
|
useTestHooksOnTop: ["jest/prefer-hooks-on-top", "vitest/prefer-hooks-on-top"],
|
|
1010
|
+
useThrowNewError: "unicorn/throw-new-error",
|
|
1011
|
+
useThrowOnlyError: "typescript/only-throw-error",
|
|
1012
|
+
useTrimStartEnd: "unicorn/prefer-string-trim-start-end",
|
|
898
1013
|
useUnicodeRegex: "require-unicode-regexp",
|
|
899
|
-
|
|
1014
|
+
useUnifiedTypeSignatures: "typescript/unified-signatures",
|
|
1015
|
+
useValidAriaRole: "jsx-a11y/aria-role",
|
|
1016
|
+
useValidAnchor: "jsx-a11y/anchor-is-valid",
|
|
1017
|
+
useValidAriaProps: "jsx-a11y/aria-props",
|
|
1018
|
+
useValidAriaValues: "jsx-a11y/aria-proptypes",
|
|
1019
|
+
useValidAutocomplete: "jsx-a11y/autocomplete-valid",
|
|
900
1020
|
useValidForDirection: "for-direction",
|
|
901
|
-
useValidLang: "
|
|
1021
|
+
useValidLang: "jsx-a11y/lang",
|
|
902
1022
|
useValidTypeof: "valid-typeof",
|
|
1023
|
+
useVarsOnTop: "vars-on-top",
|
|
1024
|
+
useVueConsistentDefinePropsDeclaration: "vue/define-props-declaration",
|
|
1025
|
+
useVueNextTickPromise: "vue/next-tick-style",
|
|
903
1026
|
useYield: "require-yield"
|
|
904
1027
|
};
|
|
905
1028
|
const WARNED_UNMAPPED_RULES_BY_REPORTER = /* @__PURE__ */ new WeakMap();
|
|
@@ -916,10 +1039,21 @@ const OXLINT_SEVERITY_NORMALIZATION = {
|
|
|
916
1039
|
};
|
|
917
1040
|
function normalizeOxlintRuleName(ruleName) {
|
|
918
1041
|
if (ruleName.startsWith("react-hooks/")) return ruleName.replace("react-hooks/", "react/");
|
|
919
|
-
if (ruleName.startsWith("
|
|
920
|
-
if (ruleName.startsWith("
|
|
1042
|
+
if (ruleName.startsWith("jsx_a11y/")) return ruleName.replace("jsx_a11y/", "jsx-a11y/");
|
|
1043
|
+
if (ruleName.startsWith("react_perf/")) return ruleName.replace("react_perf/", "react-perf/");
|
|
921
1044
|
return ruleName;
|
|
922
1045
|
}
|
|
1046
|
+
function mapBiomeRuleOptionsToOxlintSeverity(biomeName, severity, biomeSeverity) {
|
|
1047
|
+
if (biomeName === "useVueNextTickPromise") return typeof severity === "string" ? [severity, "promise"] : severity;
|
|
1048
|
+
if (biomeName !== "useConsistentMethodSignatures") return severity;
|
|
1049
|
+
if (typeof biomeSeverity !== "object" || biomeSeverity === null) return severity;
|
|
1050
|
+
const { options } = biomeSeverity;
|
|
1051
|
+
if (typeof options !== "object" || options === null || Array.isArray(options)) return severity;
|
|
1052
|
+
const { style } = options;
|
|
1053
|
+
if (style !== "method" && style !== "property") return severity;
|
|
1054
|
+
if (typeof severity !== "string") return severity;
|
|
1055
|
+
return [severity, style];
|
|
1056
|
+
}
|
|
923
1057
|
function mapBiomeRuleSeverity(severity, reporter, biomeRuleName) {
|
|
924
1058
|
const rawSeverity = typeof severity === "string" ? severity : typeof severity === "object" && severity !== null && "level" in severity ? String(severity.level) : "";
|
|
925
1059
|
const normalized = OXLINT_SEVERITY_NORMALIZATION[rawSeverity.trim().toLowerCase()];
|
|
@@ -980,7 +1114,7 @@ function extractRulesFromBiomeConfig(linterRules, reporter) {
|
|
|
980
1114
|
if (typeof ruleSeverity === "boolean" || ruleSeverity === void 0) continue;
|
|
981
1115
|
const oxlintRuleNames = mapBiomeRuleToOxlintRules(ruleName, reporter);
|
|
982
1116
|
if (oxlintRuleNames.length > 0) {
|
|
983
|
-
const oxlintSeverity = mapBiomeRuleSeverity(ruleSeverity, reporter, ruleName);
|
|
1117
|
+
const oxlintSeverity = mapBiomeRuleOptionsToOxlintSeverity(ruleName, mapBiomeRuleSeverity(ruleSeverity, reporter, ruleName), ruleSeverity);
|
|
984
1118
|
for (const oxlintRuleName of oxlintRuleNames) rules[oxlintRuleName] = oxlintSeverity;
|
|
985
1119
|
}
|
|
986
1120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "biome-to-oxc",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Migrate from Biome to Oxc ecosystem (oxlint + oxfmt + oxlint-tsgolint)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"biome",
|
|
@@ -33,24 +33,24 @@
|
|
|
33
33
|
"import": "./dist/src/index.mjs"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"commander": "15.0.0
|
|
36
|
+
"commander": "15.0.0",
|
|
37
37
|
"jsonc-parser": "next",
|
|
38
38
|
"picocolors": "^1.1.1",
|
|
39
39
|
"zod": "^4.4.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/node": "^25.9.
|
|
43
|
-
"@vitest/coverage-v8": "^4.1.
|
|
44
|
-
"oxfmt": "^0.
|
|
45
|
-
"oxlint": "^1.
|
|
42
|
+
"@types/node": "^25.9.2",
|
|
43
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
44
|
+
"oxfmt": "^0.54.0",
|
|
45
|
+
"oxlint": "^1.69.0",
|
|
46
46
|
"oxlint-tsgolint": "^0.23.0",
|
|
47
|
-
"tsdown": "^0.22.
|
|
47
|
+
"tsdown": "^0.22.2",
|
|
48
48
|
"typescript": "^6.0.3",
|
|
49
|
-
"vitest": "^4.1.
|
|
49
|
+
"vitest": "^4.1.8"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=22.22.3",
|
|
53
|
-
"pnpm": ">=11.
|
|
53
|
+
"pnpm": ">=11.5.2"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"test": "vitest",
|