
亮点
🌐 Highlights
新的 includeIgnoreFile() 助手
🌐 New includeIgnoreFile() helper
此版本引入了用于配置文件的 includeIgnoreFile() 辅助工具,它允许从 .gitignore 文件或任何其他具有 gitignore 风格模式的文件中包含模式。
🌐 This release introduces the includeIgnoreFile() helper for configuration files that allows for including patterns from .gitignore files or any other files with gitignore-style patterns.
以前在外部包 @eslint/compat 中可用,现在新的 includeIgnoreFile 辅助函数从 eslint/config 入口点导出,并提供了一个扩展的 API,允许包含多个文件,并将模式相对于这些文件的位置进行解释,这在嵌套 .gitignore 文件的常见用例中十分常见。
🌐 Previously available in the external package @eslint/compat, the new includeIgnoreFile helper function is exported from the eslint/config entrypoint and provides an extended API that allows multiple files to be included and patterns to be interpreted relative to the location of those files, which is a common use case for nested .gitignore files.
// eslint.config.js
import { defineConfig, includeIgnoreFile } from "eslint/config";
import { fileURLToPath } from "node:url";
const rootGitignorePath = fileURLToPath(
new URL(".gitignore", import.meta.url)
);
const nestedGitignorePath = fileURLToPath(
new URL("some/other/folder/.gitignore", import.meta.url),
);
export default defineConfig([
includeIgnoreFile([rootGitignorePath, nestedGitignorePath], {
// option to interpret patterns relative to the locations of the specified files
gitignoreResolution: true,
}),
{
// your overrides
},
]);
有关更多详细信息,请参阅包含 .gitignore 文件部分。
🌐 Please see the Include .gitignore Files section for more details.
特性
🌐 Features
1a45ec5功能:检查for-direction中的序列表达式 (#20701) (kuldeep kumar)450040b功能:向eslint/config添加includeIgnoreFile()(#20735) (Kirk Waiblinger)
错误修复
🌐 Bug Fixes
544c0c3修复:在调试输出中转义代码路径 DOT 标签 (#20866) (Pixel998)6799431修复:将依赖 @eslint/config-helpers 更新至 ^0.6.0 (#20850) (renovate[bot])f078fef修复:处理非数组的已弃用规则替换 (#20825) (xbinaryx)
文档
🌐 Documentation
7e52a71文档:添加对@eslint-react/eslint-plugin的提及 (#20869) (Pavel)db3468b文档:调整关于模糊 CJS 与 ESM 配置的措辞 (#20865) (Kirk Waiblinger)9084664文档:更新自述文件(GitHub Actions 机器人)9cc7387文档:更新自述文件(GitHub Actions 机器人)3d7b548文档:更新自述文件(GitHub Actions 机器人)191ec3c文档:更新自述文件(GitHub Actions 机器人)
杂项
🌐 Chores
6616856杂务:将 knip 升级到 v6 (#20875) (Pixel998)d13b084ci:确保自动创建的 PR 运行 CI (#20860) (lumir)e71c7afci: 将 pnpm/action-setup 从 6.0.5 更新到 6.0.7 (#20862) (dependabot[bot])d84393d测试:为 SuppressionsService.applySuppressions() 添加单元测试 (#20863) (kuldeep kumar)24db8cb测试:为 SuppressionsService.save() 添加测试 (#20802) (kuldeep kumar)2ef0549杂务:更新生态系统插件 (#20857) (github-actions[bot])a429791ci: 移除eslint-webpack-plugin类型的集成测试 (#20668) (Milos Djermanovic)9e37386杂项:在 code-sample-minimizer 中将recast替换为范围方法 (#20682) (Copilot)0dd1f9f测试:禁用vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER的警告 (#20845) (Francesco Trotta)9da3c7b重构:移除已弃用的meta.language并迁移meta.dialects(#20716) (Pixel998)2099ed1重构:将meta.defaultOptions添加到更多规则,启用代码检查 (#20800) (xbinaryx)f1dfbc9杂务:更新生态系统插件 (#20836) (github-actions[bot])c759413ci: 将 pnpm/action-setup 从 6.0.3 更新到 6.0.5 (#20843) (dependabot[bot])5b817d6测试:为 lib/shared/ast-utils 添加单元测试 (#20838) (kuldeep kumar)1c13ae3测试:为 lib/shared/severity 添加单元测试 (#20835) (kuldeep kumar)

