Oxlint – 比 ESLint 更快
Oxlint – Faster than ESLint

原始链接: https://oxc-project.github.io/blog/2023-12-12-announcing-oxlint.html

隆重推出 Oxlint – 满足您 Linter 需求的游戏规则改变者! 经过多年的研究和开发,我们很高兴推出 Oxlint,这是一种快速、不可配置的 JavaScript/TypeScript linter,它可以显着提高速度,同时仍然保持准确性和易用性。 与其他需要大量自定义设置的 linter 不同,Oxlint 默认情况下会检测错误、避免混淆或无意义的编码实践。 它采用 Rust 编程语言和并行处理等尖端技术来实现最佳执行时间,为阻碍生产力和减慢软件构建过程的常见问题提供实时解决方案。 根据行业标准,测试表明 Shopify 实施了 Oxlint,而不是之前的 linting 解决方案,仅使用一个 CPU 线程,将 ESLint 运行时间从 75 分钟减少到仅仅 10 秒! 凭借其全面的综合规则,用户不会错过安装多个插件的机会,也不会面临繁琐的插件管理障碍。 相反,Oxlint 提供简单、简洁、减少错误的诊断,并通过根本原因识别为开发人员提供更清晰的信息。 要亲身体验这些好处,请立即访问我们的安装指南或通过 Hacker News 加入讨论社区。 立即尝试并简化您的 JavaScript 和 TypeScript 项目工作流程! 版权所有 © 2023 年至今 Boshen & Oxc 贡献者。 根据 MIT 许可证发布。

Biome 是文本材料中提到的 Rome 工具链的最新延续,旨在提供一个开源平台,用于开发 JavaScript 模块、服务器、服务、API、库、框架、数据库、引擎和编辑器。 其目标是用优化的运行时和工具替换 Node.js 核心模块系统。 据其网站称,它提供了更好的性能、更小的占用空间、更好的启动时间以及改进的与 TypeScript 的互操作性。 此外,它还包括静态分析、测试、调试、持续集成、包管理、文档和发布功能。
相关文章

原文
  • Boshen

    BoshenProject Lead

  • We're thrilled to announce that oxlint is now generally available! This milestone signifies our team's ability to promptly address and triage issues.

    Oxlint is a JavaScript linter designed to catch erroneous or useless code without requiring any configurations by default.

    How to Use

    At this stage, oxlint is not intended to fully replace ESLint; it serves as an enhancement when ESLint's slowness becomes a bottleneck in your workflow.

    For faster feedback loops, we recommend running oxlint before ESLint in your lint-staged or CI setup, considering it only takes a few seconds to run on large codebases.

    To test oxlint in your JavaScript / TypeScript codebase, simply execute the following command at the root directory of your repository:

    Alternatively, refer to the installation guide for detailed instructions.

    Design

    50-100 Times Faster than ESLint

    In real-world scenarios, Shopify reported that their 75 CI minutes ESLint run is now only 10 seconds.

    From Jason Miller, Shopify DX and creator of Preact:

    oxlint has been a massive win for us at Shopify. Our previous linting setup took 75 minutes to run, so we were fanning it out across 40+ workers in CI.

    By comparison, oxlint takes around 10 seconds to lint the same codebase on a single worker, and the output is easier to interpret.

    We even caught a few bugs that were hidden or skipped by our old setup when we migrated!

    The majority of the performance gains stem from Oxlint being purposefully designed for performance, utilizing Rust and parallel processing as key factors.

    Lint for Correctness

    Oxlint defaults to identifying erroneous, redundant, or confusing code — prioritizing correctness over unnecessary nitpicking rules (categorized as perf, suspicious, pedantic, or style), which are disabled by default.

    Ease of Use

    Setting up new JavaScript / TypeScript codebases is becoming increasingly complex. There's a high likelihood of encountering compatibility issues among your tools, potentially resulting in hours of wasted time.

    That's why we designed oxlint to be zero-config out of the box; even Node.js is not a requirement. Most adjustments can be made through the command-line, and reading from ESLint configuration file is currently work in progress.

    Enhanced Diagnostics

    Understanding linter messages can be challenging. Oxlint aims to simplify this by pinpointing root causes and providing helpful messages — eliminating the need for lengthy rule documentation reading, saving valuable time.

    Running oxlint -D perf in the vscode repository:

    Consolidated Rules

    Oxlint does not provide a plugin system yet, but we are actively consolidating rules from popular plugins like TypeScript, React, Jest, Unicorn, JSX-a11y and Import.

    We recognize the importance of plugins in the JavaScript ecosystem and are also investigating a DSL-based plugin system.

    However, you might appreciate a standalone linter — no need to manage a list of plugin dependencies, navigate through compatibility issues, or resort to forked plugins due to version constraints.


    Happy linting and have a joyful holiday season!

    To get started, follow the installation guide, learn more about the oxc project, or discuss on Hacker News.

    联系我们 contact @ memedata.com