本帖宣布 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:
$ npx oxlint@latest$ pnpm dlx oxlint@latest$ yarn dlx oxlint@latest$ bunx oxlint@latest$ 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条规则,无需额外安装
typescript、unicorn、react、react-perf、nextjs、import、jsdoc、jsx-a11y、node、promise、jest、vitest插件的许多规则现在已经完成。- 支持通过
.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 规则数量 | 增加量 |
|---|---|---|---|
| 默认规则 | 70 | 99 | +29 条规则 |
| 正确性 | 88 | 173 | +85 条规则 |
| 性能 | 0 | 9 | +9 条规则 |
| 限制 | 15 | 64 | +49 条规则 |
| 细致 | 43 | 79 | +36 条规则 |
| 风格 | 38 | 137 | +99 条规则 |
| 可疑 | 7 | 28 | +21 条规则 |
| 规则总数 | 205 | 502 | +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/kibana | 68,591 | 6.02秒 | 3.11秒 | 1.94倍 |
microsoft/vscode | 5,703 | 1.697秒 | 0.792秒 | 2.14倍 |
vitest-dev/vitest | 1,732 | 105毫秒 | 50毫秒 | 2.1倍 |
vuejs/core | 1,063 | 217毫秒 | 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:
- @cam314、@mysteryven 和 @shulaoda 感谢他们实现了许多复杂的 lint 规则、进行测试,并不断改进一切。
- 感谢 @Sysix 维护
eslint-plugin-oxlint。 - @DonIsaac 感谢他改进配置、文档和网站,并代表 Oxc 出席 SquiggleConf 2024。
- 感谢 @leaysgur 提供正则表达式解析器和 JSDoc 插件。
- 感谢@u9g和@rzvxa实现控制流图分析。
- @branchseer 实现了多文件分析运行时。
- @camchenry 实现了嵌套配置支持。
