Skip to content

本帖宣布 Oxlint 的测试版发布。 Oxlint 现已达到 v1.0 稳定版!有关最新功能和改进,请参阅 Oxlint v1.0 稳定版公告

我们很高兴地宣布,经过社区一年多的开发,Oxlint 现已进入测试版!

🌐 We are thrilled to announce that Oxlint is now in beta release, after more than a year of development by the community!

这一里程碑代表了在功能完整性、性能和稳定性方面的重要进展。

🌐 This milestone represents a significant step forward in feature completeness, performance, and stability.

如何使用

🌐 How to use

在这个阶段,Oxlint 可以在中小型项目中完全取代 ESLint。

🌐 At this stage, Oxlint can be used to fully replace ESLint in small to medium projects.

对于较大的项目,我们建议通过 eslint-plugin-oxlint 关闭 ESLint 规则,并在本地或 CI 环境中在 ESLint 之前运行 Oxlint,以获得更快速的反馈循环。

🌐 For larger projects, our advice is to turn off ESLint rules via eslint-plugin-oxlint, and run Oxlint before ESLint in your local or CI setup for a quicker feedback loop.

要在你的代码库中测试 Oxlint,你可以在代码库的根目录使用你选择的包管理器:

🌐 To test Oxlint in your codebase, you can use the package manager of your choice at the root of your codebase:

sh
$ npx oxlint@latest
sh
$ pnpm dlx oxlint@latest
sh
$ yarn dlx oxlint@latest
sh
$ bunx oxlint@latest
sh
$ deno run npm:oxlint@latest

有关如何使用 Oxlint 以及将其与你的项目或编辑器集成的更详细说明,请查看安装指南

🌐 For more detailed instructions on how to use Oxlint and integrate it with your project or editor, check out the installation guide.

自正式发布以来的新功能亮点

🌐 Highlight of new features since general availability

  • 性能显著提升,相比之前的版本速度提高了最多一倍
  • 内置超过500条规则,无需额外安装
  • typescriptunicornreactreact-perfnextjsimportjsdocjsx-a11ynodepromisejestvitest 插件的许多规则现在已经完成。
  • 支持通过 .oxlintrc.json 文件 进行配置,包括 嵌套配置文件、使用 extends 在文件之间共享配置、将 overrides 应用于特定文件等。
  • 支持在 .astro.svelte.vue 文件中的 <script> 内容进行 lint 检查,无需额外配置。
  • 允许将自动修复和建议应用到文件中。

规则越多,性能越强

🌐 More rules, more performance

我们专注于让 Oxlint 功能更完善,支持许多最常用的 ESLint 规则和插件,同时我们也让 Oxlint 运行得更快。

🌐 We have focused on making Oxlint more feature complete, supporting many of the most commonly used ESLint rules and plugins, but we have also made Oxlint much faster as well.

Oxlint 的第一个正式发布(GA)版本 总共有 205 条规则,其中 70 条默认启用。这个测试版现在总共有 502 条规则,其中 99 条默认启用(默认启用的规则数量增加了 41%)。

🌐 The first generally available (GA) release of Oxlint had 205 rules in total, with 70 of those being enabled by default. This beta release now includes 502 rules in total, with 99 of those being enabled by default (a 41% increase in the number of rules enabled by default).

规则类型GA 规则数量beta 规则数量增加量
默认规则7099+29 条规则
正确性88173+85 条规则
性能09+9 条规则
限制1564+49 条规则
细致4379+36 条规则
风格38137+99 条规则
可疑728+21 条规则
规则总数205502+297 条规则

尽管增加了许多默认启用的新规则,Oxlint现在比以往任何时候都快。以下是一些流行代码库的基准测试

🌐 Despite adding many new rules that are enabled by default, Oxlint is now much faster than it ever has been. Here are some benchmarks on some popular repositories:

仓库文件数Lint 时间 (GA)Lint 时间 (beta)加速
elastic/kibana68,5916.02秒3.11秒1.94倍
microsoft/vscode5,7031.697秒0.792秒2.14倍
vitest-dev/vitest1,732105毫秒50毫秒2.1倍
vuejs/core1,063217毫秒89毫秒2.44倍

路线图

🌐 Roadmap

Oxlint 最常被要求的功能之一是支持现有的自定义 ESLint 插件。我们一直在努力完善该功能的前置条件,并启用用JavaScript编写的快速linter插件。我们希望在下一次重大发布中推出此功能,并在不久的将来分享更多信息。

🌐 One of the most commonly requested features for Oxlint is support for existing custom ESLint plugins. We have been busy working on the prerequisites for this feature, and to enable fast linter plugins written in JavaScript. We hope to have this feature available for the next major release, and more information to share about it in the near future.

我们也计划继续改进 IDE/编辑器的集成,并增强对 VSCode、Zed、coc.nvim 以及 IntelliJ 插件的支持。

🌐 We also are planning to continue improving the IDE/editor integrations, with improved support for VSCode, Zed, coc.nvim, and IntelliJ plugins.

致谢

🌐 Acknowledgements

如果没有该项目的 200 多名贡献者,Oxlint 测试版是不可能实现的。

🌐 Oxlint beta would not have been possible without the over 200 contributors to the project.

特别感谢:

🌐 Special thanks goes to: