
亮点
🌐 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
错误修复
🌐 Bug Fixes
19c0127修复:改进no-console建议的消息 (#19483) (Francesco Trotta)49e624f修复:改进对假的解析 JS AST 的错误信息 (#19458) (Josh Goldberg ✨)
文档
🌐 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
