
亮点
🌐 Highlights
此版本包含以下重大更改:
🌐 This release contains the following breaking changes:
它还增加了对以下新语言功能的支持:
🌐 It also adds support for the following new language features:
- 核心规则现在支持
globalThis。
正在安装
🌐 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.3 --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
78c8cda最新消息:RuleTester 改进 (参考 eslint/rfcs#25) (#12955) (Milos Djermanovic)185982d最新消息:改进插件解析(参考 eslint/rfcs#47)(#12922)(Toru Nagashima)48b122f重大更新:使用 --config 更改相对路径(参考 eslint/rfcs#37)(#12887)(Toru Nagashima)
增强功能
🌐 Enhancements
e0f1b6c更新:在 no-magic-numbers 中对数组索引进行了更严格的检查(修复 #12845) (#12851) (Milos Djermanovic)362713c更新:改进 template-curly-spacing 的报告位置 (#12813) (Milos Djermanovic)105384c更新:在 operator-linebreak 中报告操作符位置(参考 #12334) (#13102) (Milos Djermanovic)081e240更新:no-implied-eval 中支持 globalThis(修复 #12670)(#13105) (YeonJuan)a1370ab更新:在 no-obj-calls 中报告构造函数调用 (#12909) (Milos Djermanovic)085979f更新:在 no-implied-eval 中考虑环境(修复 #12733)(#12757) (YeonJuan)e90b29b更新:允许在 RuleTester 中使用数据测试 Suggestions(修复 #12606) (#12635) (Milos Djermanovic)183e300更新:支持 globalThis(参考 #12670) (#12774) (YeonJuan)1299705更新:acorn 版本 (#13016) (Idan Avrahami)
错误修复
🌐 Bug Fixes
29f32db修复:更改隐式文件忽略的错误消息逻辑(修复 #12873) (#12878) (Scott Hardin)eb1a43c修复: require-await 忽略异步生成器 (修复 #12459) (#13048) (Anix)920465b修复:获取 getNameLocationInGlobalDirectiveComment 的结束位置 (参考 #12334) (#13086) (Milos Djermanovic)ae14a02修复:在 no-extra-bind 中向报告添加结束位置 (参考 #12334) (#13083) (Milos Djermanovic)0c20bc0修复:在 camelcase 中检查赋值属性目标(修复 #13025)(#13027) (YeonJuan)8d50a7d修复:在 no-prototype-builtins 中向报告添加结束位置 (参考 #12334) (#13087) (Milos Djermanovic)3e4e7f8修复:no-extra-boolean-cast 修复器中必需括号的逻辑错误 (#13061) (Milos Djermanovic)aef9488修复:允许在 id-blacklist 中引用外部全局变量(修复 #12567)(#12987) (Milos Djermanovic)4955c50修复:在 prefer-object-spread 中移除类型参数(修复 #13058)(#13063) (Milos Djermanovic)dbe357d修复:在 prefer-numeric-literals 中检查模板字面量(修复 #13045)(#13046) (YeonJuan)2260611修复:在 no-empty-function 的 allow 方法中添加了 async(修复 #12768)(#13036) (Anix)7224eee修复: no-plusplus 允许在 for 后的表达式中使用逗号操作符 (修复 #13005) (#13024) (Milos Djermanovic)7598cf8修复:通过 --init 创建配置时在文件末尾前添加换行 (#12952) (Andreas Lind)0243549修复:camelcase 在计算属性上误报 (修复 #13022) (#13023) (Milos Djermanovic)6cef0d5修复:检查 astUtils.canTokensBeAdjacent 中的除法运算符 (#12879) (Milos Djermanovic)
文档
🌐 Documentation
6c069f9文档:在示例的代码块中添加注释 (#13089) (Kibeom Kwon)ee1f053文档:修复拼写错误 (#13092) (Max Coplan)76324ac文档:向规则添加进一步阅读 (#13084) (Max Coplan)3f7c9bf文档:在 no-use-before-define 中阐明 variables 选项(修复 #12986)(#13017)(Anix)9ac5b9e文档:澄清 node_modules 默认被忽略(修复 #13006) (#13054) (Mika Kuijpers)0de91f3文档:从错误示例中删除正确代码 (#13060) (Anix)af7af9d文档:更新治理 (#13055) (Nicholas C. Zakas)79ac6cd文档:为 func-style 添加了不那么混乱的解释(修复 #12900)(#13004)(Anix)
依赖升级
🌐 Dependency Upgrades
2111c52升级:esquery@1.2.0 (#13076) (Milos Djermanovic)95613d4升级:espree@6.2.1 (#13026) (Kai Cataldo)
杂项
🌐 Chores
