ESLint v9.22.0 发布

我们刚刚发布了 ESLint v9.22.0,这是 ESLint 的一次小版本升级。此版本添加了一些新功能,并修复了上一版本中发现的几个错误。

亮点

🌐 Highlights

新的 defineConfig()globalIgnores() 助手

🌐 New defineConfig() and globalIgnores() helpers

此版本为配置文件引入了 defineConfig()globalIgnores() 辅助工具。defineConfig() 辅助工具为你的配置文件引入了类型安全,同时还使你能够使用新的 extends 键。globalIgnores() 辅助工具确保你的全局忽略不会意外变成本地忽略。以下是一个使用两者的示例:

🌐 This release introduces the defineConfig() and globalIgnores() helpers for configuration files. The defineConfig() helper brings type safety into your configuration file and also enables you to use the new extends key. The globalIgnores() helper ensures that your global ignores aren’t accidentally turned into local ignores. Here’s an example using both:

// eslint.config.js
import { defineConfig, globalIgnores } from "eslint/config";
import js from "@eslint/js";

export default defineConfig([
    {
        files: ["src/**/*.js"],
        plugins: { js },
        extends: ["js/recommended"],    // extend the plugin's recommended config
        rules: {
            semi: "error"
        }
    },
    globalIgnores(["dist", "build"])
]);

我们认为这些辅助工具使创建和管理配置文件更加容易。你可以在公告博客文章中找到所有详细信息。

🌐 We think these helpers make creating and managing configuration files a lot easier. You can find all the details in the announcement blog post.

特性

🌐 Features

  • 7ddb095 功能:导出 defineConfig,globalIgnores (#19487) (Nicholas C. Zakas)

错误修复

🌐 Bug Fixes

文档

🌐 Documentation

  • 86c5f37 文档:更新自述文件(GitHub Actions 机器人)
  • fbdeff0 文档:更新自述文件(GitHub Actions 机器人)
  • c9e8510 文档:从规则元数据在 TSDoc 注释中生成弃用通知 (#19461) (Francesco Trotta)
  • 2f386ad 文档:在规则示例中将 var 替换为 const (#19469) (Tanuj Kanti)
  • 0e688e3 文档:更新自述文件(GitHub Actions 机器人)
  • 06b596d 文档:将光标恢复到搜索输入丢失的位置 (#19459) (Amaresh S M)

杂项

🌐 Chores

  • 97f788b 杂务:升级 @eslint/js@9.22.0 (#19489) (Milos Djermanovic)
  • eed409a 事务:更新 package.json 以适配 @eslint/js 版本发布(Jenkins)
  • f9a56d3 杂务:升级 eslint-scope 至 8.3.0 (#19488) (Milos Djermanovic)

最新的 ESLint 新闻、案例研究、教程和资源。

ESLint v10.3.0 发布
1 min read

ESLint v10.3.0 发布

我们刚刚发布了 ESLint v10.3.0,这是 ESLint 的一次小版本升级。此版本添加了一些新功能,并修复了上一版本中发现的几个错误。

ESLint v10.2.1 发布
1 min read

ESLint v10.2.1 发布

我们刚刚发布了 ESLint v10.2.1,这是 ESLint 的一个补丁版本升级。本次发布修复了上一版本中发现的几个错误。

ESLint v10.2.0 发布
2 min read

ESLint v10.2.0 发布

我们刚刚发布了 ESLint v10.2.0,这是 ESLint 的一次小版本升级。此版本添加了一些新功能,并修复了上一版本中发现的几个错误。