
亮点
🌐 Highlights
此版本的大部分亮点都是破坏性更改,更多内容请参阅迁移指南。
🌐 Most of the highlights of this release are breaking changes, and are discussed further in the migration guide.
正在安装
🌐 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@7.0.0-alpha.1 --save-dev
迁移指南
🌐 Migration Guide
由于有很多变化,我们创建了一个迁移指南,详细描述了这些变化以及你应采取的步骤来应对它们。我们预计大多数用户应该能够在不进行任何构建更改的情况下升级,但如果你遇到问题,迁移指南应该是一个有用的资源。
🌐 As there are a lot of changes, we’ve created a migration guide describing the 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
4293229最新消息: use-isnan 在 switch case 中强制默认true(修复 #12810) (#12913) (Milos Djermanovic)cf38d0d最新消息:更改默认忽略模式(参考 eslint/rfcs#51) (#12888)(Toru Nagashima)bfe1dc4最新消息: no-dupe-class-members 检查一些计算键(修复 #12808) (#12837) (Milos Djermanovic)c2217c0爆料:使radix规则更严格 (#12608)(fisker Cheung)
增强功能
🌐 Enhancements
1ee6b63更新:在 yoda 中检查模板字符串(修复 #12863)(#12876) (YeonJuan)439c833更新: array-callback-return 检查 Array.forEach(修复 #12551)(#12646) (Gabriel R Sezefredo)03a69db更新:检查 no-proto、no-iterator 中的模板字面量(修复 #12801)(#12806)(YeonJuan)[562e784](https://github.com/eslint/eslint/commit/562e7845946a490f2e173a0bcd1af631070a4eef)更新:修复 no-magic-numbers 在使用 ignoreArrayIndexes 时的错误否定 (#12805)(Milos Djermanovic)0460748更新:在 no-constant-condition 中检查模板字面量(修复 #12815)(#12816)(YeonJuan)
错误修复
🌐 Bug Fixes
1f1424c修复:修复 no-extra-parens 中不一致工作的选项 (修复 #12717) (#12843) (YeonJuan)b5adcaa修复:使 YieldExpression 可抛出(修复 #12880)(#12897) (YeonJuan)95e0586修复:id-blacklist 在重命名的导入上误报 (#12831) (Milos Djermanovic)dadc892修复:operator-assignment 在相邻除法赋值时崩溃 (#12844) (Milos Djermanovic)a9d92f9修复: radix 规则在禁用的全局变量上崩溃 (#12824) (Milos Djermanovic)533c114修复: multiline-comment-style 规则在 * 后添加额外空格 (修复 #12785) (#12823) (Karthik Priyadarshan)80309c3修复:no-constant-condition 不会检查数组(修复 #12225) (#12307) (Sean Gray)
文档
🌐 Documentation
f702b1a文档:添加遗失的插件引用 (#12796) (Eduard Bardají Puig)824d235文档:向 CLIEngine 添加 errorOnUnmatchedPattern 选项 (#12834) (Arthur Denner)33efd71文档:修复拼写错误 (#12861) (Bryan Mishkin)a5b3c5f文档:更新 README 团队和赞助商(ESLint Jenkins)d6c313d文档:在 prefer-regex-literals 示例中添加缺失的 eslint 注释 (#12858) (Milos Djermanovic)aea1729文档:修复 Node.js API 目录中的锚点链接 (#12821) (Matija Marohnić)
杂项
🌐 Chores
1907e57工作项:添加 Twitter 和 Open Collective 徽章 (#12877) (Kai Cataldo)b7f0d20工作: 使用一致的徽章样式 (#12825) (fisker Cheung)3734a66任务:为消息使用ID (#12859) (Gareth Jones)0cae920任务:重命名被遮蔽的全局变量 (#12862) (Tony Brix)055b80d工作:修复 complexity.js 中的拼写错误 (#12864) (Kyle Shevlin)9f39ef0任务:PULL_REQUEST_TEMPLATE.md 中的拼写错误 (#12848) (Balázs Orbán)a60d5cd工作:在 no-irregular-whitespace.js 中的拼写错误 (#12847) (Balázs Orbán)691d19a事务:添加缺失的ecmaVersion2020/11 类型值 (#12833) (Piotr Błażejewicz (Peter Blazejewicz))f5b9656任务:为 no-constant-condition 添加测试 (#12836) (Milos Djermanovic)10a79a6任务:在内部采用eslint-plugin/require-meta-docs-description(#12762) (Bryan Mishkin)
