
亮点
🌐 Highlights
此版本的 ESLint 尚未准备好用于生产环境,提供此版本是为了在发布最终版本之前收集社区的反馈。如果你遇到任何问题或有任何反馈,请通过在我们的 GitHub 仓库 创建问题告诉我们。
🌐 This version of ESLint is not ready for production use and is provided to gather feedback from the community before releasing the final version. Please let us know if you having any problems or feedback by creating issues on our GitHub repo.
此版本的大部分亮点都是重大更改,并在迁移指南中有更详细的讨论。下面是重大更改的摘要。(不太重要的更改包含在迁移指南中。)
🌐 Most of the highlights of this release are breaking changes, and are discussed further in the migration guide. There are summaries of the significant changes below. (Less significant changes are included in the migration guide.)
此 ESLint 预发布版本有一个单独的文档部分。
🌐 This prerelease version of ESLint has a separate documentation section.
已移除已弃用的 SourceCode 方法
🌐 Removed deprecated SourceCode methods
以下 SourceCode 方法不再可用:
🌐 The following SourceCode methods are no longer available:
getTokenOrCommentBefore()- 改用带有{ includeComments: true }选项的getTokenBefore()getTokenOrCommentAfter()- 改用带有{ includeComments: true }选项的getTokenAfter()isSpaceBetweenTokens()- 请改用isSpaceBetween()getJSDocComment()- 无替换
尚未更新其代码的插件用户可以在此期间使用@eslint/compat工具。
🌐 Users of plugins that haven’t updated their code yet can use the @eslint/compat utility in the meantime.
正在安装
🌐 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@10.0.0-alpha.1 --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.
重大更改
🌐 Breaking Changes
fa31a60增强功能!: 将name添加到配置 (#20015) (Kirk Waiblinger)3383e7e修复!: 移除已弃用的SourceCode方法 (#20137) (Pixel998)501abd0重大更新!: 将依赖 minimatch 更新到 v10 (#20246) (renovate[bot])ca4d3b4修复!: 对有效测试用例的更严格规则测试断言 (#20125) (唯然)
特性
🌐 Features
09e6654功能:更新require-yield和no-useless-constructor的错误位置 (#20267) (Tanuj Kanti)
文档
🌐 Documentation
0f5a94a文档:[class-methods-use-this] 解释规则的目的 (#20008) (Kirk Waiblinger)df5566f文档:为所有规则文档添加选项部分 (#20296) (sethamus)adf7a2b文档: no-unsafe-finally 对生成器函数的注释 (#20330) (Tom Pereira)ef7028c文档:更新自述文件(GitHub Actions 机器人)fbae5d1文档:在迁移指南中始终使用 “v10.0.0” (#20328) (Pixel998)778aa2d文档:忽略默认文件模式 (#20312) (Tanuj Kanti)
杂项
🌐 Chores
0b14059事务:更新 package.json 以适配 @eslint/js 版本发布(Jenkins)d6e7bf3ci:将 actions/checkout 从 5 升级到 6 (#20350) (dependabot[bot])139d456事务: 要求规则文档中必须的标题 (#20347) (Milos Djermanovic)3b0289c事务: 移除未使用的.eslintignore和测试夹具 (#20316) (Pixel998)a463e7b事务:将依赖 js-yaml 更新到 v4 [安全] (#20319) (renovate[bot])ebfe905事务: 从 eslint-config-eslint 中移除冗余规则 (#20327) (Milos Djermanovic)88dfdb2测试:为消息占位符插值添加回归测试 (#20318) (fnx)6ed0f75事务:在eslint-config-eslint中跳过类型检查 (#20323) (Francesco Trotta)
