
亮点
🌐 Highlights
此版本的大部分亮点都是破坏性更改,更多内容请参阅迁移指南。
🌐 Most of the highlights of this release are breaking changes, and are discussed further in the migration guide.
除了重大变更外,我们还有三条新规则:
🌐 In addition to the breaking changes, we have three new rules:
正在安装
🌐 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.0 --save-dev
迁移指南
🌐 Migration Guide
由于有很多变化,我们正在编写一份迁移指南,详细描述这些变化以及你应该采取的应对步骤。我们预计大多数用户应该可以在不更改构建的情况下进行升级,但如果你遇到问题,迁移指南将是一个有用的资源。
🌐 As there are a lot of changes, we’re working on 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
1aa021d最新消息:lintoverrides文件(修复 #10828,参考 eslint/rfcs#20)(#12677) (Toru Nagashima)b50179d最新消息:检查 no-extra-parens 中的赋值目标 (#12490) (Milos Djermanovic)d86a5bb突发新闻:在 array-callback-return 中检查 flatMap(修复 #12235)(#12765)(Milos Djermanovic)[cf46df7](https://github.com/eslint/eslint/commit/cf46df70158a4ed4c09d5c9d655c07dc6df3ff5e)爆料:指令注释中的描述 (参考 eslint/rfcs#33) (#12699) (Toru Nagashima)7350589最新消息:一些规则支持 bigint 字面量(修复了 #11803)(#12701) (Toru Nagashima)1118fce最新消息:在 ‘~/.eslintrc’ 上的运行时弃用(参考 eslint/rfcs#32)(#12678) (Toru Nagashima)2c28fbb重大更新:停止支持 Node.js 8(参考 eslint/rfcs#44) (#12700) (Toru Nagashima)
特性
🌐 Features
f9774ec新增:添加 default-case-last 规则(修复 #12665)(#12668) (Milos Djermanovic)a1d999c新增:添加 no-useless-backreference 规则(修复 #12673)(#12690) (Milos Djermanovic)985dac3新增:添加 no-restricted-exports 规则(修复 #10428)(#12546)(Milos Djermanovic)
增强功能
🌐 Enhancements
e59d775更新:为 array-element-newline (#11796) 提供单独的模式/表达式选项 (jacobparish)f8f115a更新:在 template-curly-spacing 中处理注释标记(修复 #12744)(#12775)(YeonJuan)9a93d9e更新:修复 no-restricted-imports export * 假阴性(修复 #12737)(#12798) (Milos Djermanovic)68becbd更新:修复 no-restricted-imports importNames 报告(修复 #12282)(#12711) (Andrey Alexandrov)ae959b6更新:在 no-extra-parens 中报告多余的双括号(修复 #12127) (#12697) (YeonJuan)b2c6209更新:修复 no-extra-parens CallExpression#callee 的假阴性 (#12743) (Milos Djermanovic)14b42c3更新:修复在 max-len 中计算 JSX 注释长度的错误(修复 #12213)(#12661)(YeonJuan)313f70a更新:在 indent 规则中添加 outerIIFEBody: “off”(修复 #11377)(#12706)(Kai Cataldo)3fa39a6更新:处理计算属性键中本地不支持的正则表达式 (#12056) (Milos Djermanovic)8f1020f更新: no-void 添加一个选项以允许将 void 作为语句 (#12613) (Brad Zacher)bb6cf50更新:为 indent 规则添加 offsetTernaryExpressions 选项 (#12556) (Adam Stankiewicz)
错误修复
🌐 Bug Fixes
de4fa7c修复:在 indent 中标记模板的 indent 错误(修复 #12122) (#12596) (YeonJuan)16a1c1f修复: prefer-object-spread 在访问器中的误报 (修复 #12086) (#12784) (Milos Djermanovic)0d8c0af修复:改进 computed-property-spacing 的报告位置 (#12795) (Milos Djermanovic)756b95d修复: id-blacklist 应忽略对象模式 (修复 #12787) (#12792) (JP Ramassini)01ff791修复:在测试输出中正确显示管道字符 (#12771) (Brad Zacher)00ddfff修复:Windows 路径解析用于 JUnit(修复 #12507)(#12509) (Michael Wall)1aff21b修复: no-mixed-spaces-and-tabs 报告多行字符串 (#12566) (Milos Djermanovic)
文档
🌐 Documentation
02fcc05文档:改进 sort-keys (#12791) (Steven Vachon)25eb703文档:修复 max-lines 规则文档中的失效链接 (#12766) (Christian Bundy)098b67d文档:修复 brace-style.md 中的小拼写错误 (#12749) (Marko Kaznovac)b23ad0d文档:在 working-with-rules.md 中更改损坏的链接 (#12732) (Damien Cassou)
依赖升级
🌐 Dependency Upgrades
构建相关
🌐 Build Related
4e16957构建:更新浏览器构建 (#12693) (Toru Nagashima)827259e构建:为 eslint-config-eslint 发布更新 package.json(ESLint Jenkins)
杂项
🌐 Chores
561b6d4工作项:在 PR 模板中添加前置条件检查清单 (#12790) (Kai Cataldo)9dfc850任务:重构以在多个规则中使用 messageId (#12715) (Brad Zacher)b77b858工作:修复 one-var 规则的 separateRequires 测试 (#12709) (Milos Djermanovic)e4df7df任务:为 RuleTester 测试用例添加 JSDoc 类型 (#12325) (Chiawen Chen)4744397事务: 删除 max-lines-per-function 中未使用的代码 (#12659) (YeonJuan)39f5a45任务:为 for-direction 添加测试用例 (#12698) (YeonJuan)b340304杂务:添加额外测试,改进文档 (#12492) (Kevin Partington)
