
亮点
🌐 Highlights
这是本版本 ESLint 中你需要了解的主要更改的总结。
🌐 This is a summary of the major changes you need to know about for this version of ESLint.
正在安装
🌐 Installing
由于这是预发布版本,npm 不会自动升级。安装时必须指定 next 标签:
🌐 Since this is a pre-release version, you will not automatically be upgraded by npm. You must specify the next tag when installing:
npm i eslint@next --save-dev
你也可以直接指定版本:
🌐 You can also specify the version directly:
npm i eslint@9.0.0-alpha.2 --save-dev
迁移指南
🌐 Migration Guide
由于有很多变化,我们创建了一个 迁移指南,详细描述了重大更改以及你应该采取的应对步骤。我们预计大多数用户应该能够在不更改构建的情况下升级,但如果遇到问题,迁移指南应该是一个有用的资源。
🌐 As there are a lot of changes, we’ve created a migration guide describing the breaking changes in great detail along with the steps you should take to address them. We expect that most users should be able to upgrade without any build changes, but the migration guide should be a useful resource if you encounter problems.
no-restricted-imports 配置改进
🌐 no-restricted-imports configuration improvements
在 v8.x 中,如果你为 no-restricted-imports 规则的配置中的 paths 数组有多个条目具有相同的 name 属性,只有最后一个会生效。在 v9.0.0 中,所有条目都会生效,允许为不同的导入名称指定不同的错误消息。
🌐 In v8.x, if multiple entries in the paths array of your configuration for the no-restricted-imports rule had the same name property, only the last one would apply. In v9.0.0, all entries apply, allowing for specifying different error messages for different imported names.
RuleTester 检查重复的测试
🌐 RuleTester checks for duplicate tests
从 v9.0.0 起,RuleTester 可以检测并报告重复的测试用例。
🌐 As of v9.0.0, RuleTester detects and reports duplicate test cases.
重大更改
🌐 Breaking Changes
[57089cb](https://github.com/eslint/eslint/commit/57089cb5166acf8b8bdba8a8dbeb0a129f841478)功能更新!: no-restricted-imports 允许同一路径的多个配置条目 (#18021) (Milos Djermanovic)2e1d549功能更新!: 检测重复测试用例 (#17955) (Bryan Mishkin)
特性
🌐 Features
26093c7功能:修复no-this-before-super中的假阴性 (#17762) (太田洋介)5471e43功能:将不安全的自动修复转换为no-implicit-coercion中的建议 (#17985) (Gürgün Dayıoğlu)e3051be功能:当检测到.eslintignore文件时发出警告 (#17952) (Nitin Kumar)
错误修复
🌐 Bug Fixes
文档
🌐 Documentation
33d1ab0文档:在 flat 配置忽略文档中添加更多示例 (#18020) (Milos Djermanovic)e6eebca文档:更新 sort-keys 选项属性计数 (#18025) (LB (Ben Johnston))1fedfd2文档:改进平面配置忽略文档 (#17997) (Nicholas C. Zakas)38b9b06文档:更新 valid-typeof 规则 (#18001) (Tanuj Kanti)b4abfea文档:更新有关 ECMAScript 支持的说明 (#17991) (Francesco Trotta)6788873文档:更新发布博客文章模板 (#17994) (Nicholas C. Zakas)1f37442文档:添加关于非 npm 插件配置的章节 (#17984) (Nicholas C. Zakas)
杂项
🌐 Chores
6ffdcbb事务: 升级 @eslint/js@9.0.0-alpha.2 (#18038) (Milos Djermanovic)2c12715事务:更新 package.json 以适配 @eslint/js 版本发布(Jenkins)cc74c4d杂项:升级 espree@10.0.0 (#18037) (Milos Djermanovic)dfb68b6任务:为文档网站使用 Node.js 20 (#18026) (Milos Djermanovic)8c1b8dd测试:为忽略文件和目录添加更多测试 (#18018) (Milos Djermanovic)60b966b事务: 将依赖 @eslint/js 更新到 v9.0.0-alpha.1 (#18014) (renovate[bot])c893bc0事务:将markdownlint更新为v0.33.0(#17995) (Nitin Kumar)
