更新时间:2026-03-14
对当前仓库,Oxlint + jsPlugins 已经足以承接大部分 JS/TS lint 规则,但现阶段无法在不丢失 lint 能力的前提下完全替换 ESLint。
更准确的判断是:
根据 Oxc 官方文档,Oxlint 的 JS Plugins 目前具备这些特征:
jsPlugins 仍处于 alpha,不受 semver 稳定性约束。另外,官方内建 vue 插件当前只覆盖“适用于 script tags 的规则”,并不等价于完整的 eslint-plugin-vue 模板规则集。
官方文档:
关键点摘录来源:
js-plugins.htmljs-plugins.htmlvue 仅覆盖 script tags 可用规则:plugins当前仓库已经不是“Oxlint 还没开始接管”的状态,而是Oxlint 已经承担主体,ESLint 负责补位。
两者都只是薄封装:
@vben/eslint-config@vben/oxlint-config见 scripts/vsh/src/lint/index.ts:
oxlint . 和 eslint . --cacheoxlint . --fix 和 eslint . --cache --fix这说明工具链层面已经默认接受“Oxlint 负责大部分,ESLint 保留兜底”的模式。
见 internal/lint-configs/oxlint-config/src/configs/plugins.ts:
import、node、oxc、typescript、unicorn、vitest、vue见 internal/lint-configs/oxlint-config/src/configs/tailwindcss.ts:
jsPlugins 接入 eslint-plugin-better-tailwindcss这说明仓库已经验证过一个重要前提:Oxlint 的 jsPlugins 在本项目里不是理论能力,而是已经在生产配置中使用。
见 internal/lint-configs/eslint-config/src/configs/vue.ts:
vue-eslint-parserpluginVue.processors?.['.vue']vue/attribute-hyphenationvue/html-self-closingvue/v-on-event-hyphenationvue/block-ordervue/require-default-propvue/one-component-per-file这部分明显超出“只 lint <script> block”的范围。按官方当前说明,这部分不能无损迁到 Oxlint。
见 internal/lint-configs/eslint-config/src/configs/jsonc.ts:
language: 'jsonc/x'eslint-plugin-jsoncjsonc/sort-keysjsonc/sort-array-values这部分不是普通 JS 插件规则,而是建立在 JSONC 语言支持之上。当前不能假设 Oxlint 已可完全承接。
见:
当前依赖:
yaml-eslint-parsereslint-plugin-ymleslint-plugin-pnpm并且覆盖了 pnpm-workspace.yaml 的专门规则,例如:
yaml/sort-keyspnpm/yaml-no-duplicate-catalog-itempnpm/yaml-no-unused-catalog-item这类场景正好命中官方当前未完成的“custom file formats and parsers”边界。
当前 ESLint 配置中仍有这些额外插件:
@eslint-community/eslint-plugin-eslint-commentseslint-plugin-commandeslint-plugin-perfectionisteslint-plugin-pnpmeslint-plugin-jsonceslint-plugin-ymleslint-config-turbo其中有些理论上可以尝试通过 jsPlugins 迁过去,但目前仓库还没有完成这一步。
这些已经在 Oxlint 中直接落地,或者已存在等价内建支持:
importnodeunicornvitestvue script 规则better-tailwindcss 这类标准 ESLint JS 插件对应配置位于:
jsPlugins 的部分这些不明显依赖自定义文件格式,值得单独实验:
@eslint-community/eslint-plugin-eslint-commentseslint-plugin-commandeslint-plugin-perfectionist但是否能稳定接入,仍需实测:
这些是现阶段最明确的保留项:
eslint-plugin-vue 的模板级规则eslint-plugin-jsonceslint-plugin-ymleslint-plugin-pnpm目标:保留 ESLint,但把它压缩成“补位层”。
执行方式:
eslint-comments、command、perfectionist 是否能迁入 jsPlugins。这样做的收益:
目标:立即删掉 ESLint,只保留 Oxlint。
代价:
除非团队明确接受上述损失,否则不建议执行。
如果要继续推进,建议按这个顺序做:
eslint-commentscommandperfectionistscripts/vsh/src/lint/index.ts 中 ESLint 的职责缩到最小。oxlint 负责主 linteslint 只负责 Vue/JSONC/YAML/pnpm 补位对这个仓库,当前最合理的目标不是“ESLint 全量迁移到 Oxlint”,而是:
把能迁的都迁到 Oxlint,把不能迁的留给一个精简后的 ESLint。
这是当前官方能力边界、仓库已有配置、以及风险收益比三者共同决定的结论。