
亮点
🌐 Highlights
本版本的大部分亮点都是重大变更,并在迁移指南中有进一步讨论。此外,还有一些新功能:
🌐 Most of the highlights of this release are breaking changes, and are discussed further in the migration guide. In addition, there are some new features:
- 默认解析器现在支持 ES2022 语法,包括类字段和顶层
await。一些规则仍需更新,你可以在 跟踪问题 上关注进展。 - 当使用
--fix与--report-unused-disable-directives时,Autofix 增加了删除未使用禁用指令的支持。
由于这是测试版发布,因此不应期望它可以用于生产环境,但请尝试使用并报告任何意外问题。
🌐 Since this is a beta release, it is not expected to be ready for production, but please try it and report any unexpected issues.
正在安装
🌐 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@8.0.0-beta.0 --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
24c9f2a突发新闻:严格的包导出(参考 #13654)(#14706)(Nicholas C. Zakas)86d31a4最新消息:在 RuleTester 中禁止使用 SourceCode#getComments()(参考 #14744)(#14769)(Milos Djermanovic)1d2213d最新消息:可修复的禁用指令(修复 #11815)(#14617)(Josh Goldberg)4a7aab7最新消息:可修复规则需要meta(修复 #13349) (#14634) (Milos Djermanovic)d6a761f最新消息:规则建议需要meta.hasSuggestions(#14573) (Bryan Mishkin)4c841b8重大更新:允许在行注释中使用所有指令(修复 #14575)(#14656)(薛定谔的猫)6bd747b最新消息:支持新的正则表达式 d 标志(修复 #14640) (#14653)(太田洋介)8b4f3ab快讯:修复 comma-dangle 方案(修复 #13739) (#14030) (Joakim Nilsson)b953a4e重大更新:升级 espree 并支持新的类特性 (参考 #14343) (#14591) (Toru Nagashima)8cce06c重大更新:向 eslint:recommended 添加一些规则(参考 #14673)(#14691)(薛定谔的猫)86bb63b最新消息:删除codeframe和table格式化器 (#14316) (Federico Brigante)f3cb320重大更新:放弃支持 node v10/v13/v15(修复 #14023)(#14592) (薛定谔的猫)
增强功能
🌐 Enhancements
9052eee更新:检查 no-extra-parens 中的类字段(参考 #14857)(#14906) (Milos Djermanovic)
错误修复
🌐 Bug Fixes
af96584修复:在 operator-linebreak 中处理计算的类字段(参考 #14857)(#14915)(Milos Djermanovic)a773b99修复:使用类字段时no-useless-computed-key的边缘情况(参考 #14857) (#14903) (Milos Djermanovic)cbc43da修复:prefer-destructuring PrivateIdentifier 误报 (参考 #14857) (#14897) (Milos Djermanovic)ccb9a91修复:点表示法 对私有标识符的误报(参考 #14857)(#14898) (Milos Djermanovic)
文档
🌐 Documentation
28fe19c文档:添加 v8.0.0 迁移指南(修复 #14856)(#14884) (Nicholas C. Zakas)1f5d088文档:为规则 no-import-assign 添加一个示例Object.assign()(#14916) (薛定谔的猫)c4e5802文档:改进no-console的规则细节(修复 #14793)(#14901)(Nitin Kumar)5c3a470文档:在 no-multi-assign 文档中添加类字段(参考 #14857)(#14907)(Milos Djermanovic)d234d89文档:在 func-names 文档中添加类字段(参考 #14857)(#14908)(Milos Djermanovic)e037d61文档:提到在选择器中对斜杠字符进行转义的解决方法 (#14675) (Aria)81f03b6文档:更新许可证版权 (#14877) (Nicholas C. Zakas)
依赖升级
🌐 Dependency Upgrades
ec9db63升级:@eslint/eslintrc@1.0.0 (#14865) (Milos Djermanovic)62c6fe7升级:调试 4.0.1 > 4.3.2 (#14892) (sandesh bafna)88db3f5升级:js-yaml到 v4 (#14890) (Bryan Mishkin)ae6072b升级:eslint-visitor-keys到 v3 (#14902) (Bryan Mishkin)e53d8cf升级:markdownlint开发依赖 (#14883) (Bryan Mishkin)d66e941升级: @humanwhocodes/config-array 到 0.6 (#14891) (Bryan Mishkin)
构建相关
🌐 Build Related
杂项
🌐 Chores
be334f9任务:修复 Makefile 对 linter.getRules() 的调用 (#14932) (Brandon Mills)0c86b68工作: 替换 Array flat/flatMap 的旧语法 (#14614) (Stephen Wade)6a89f3f任务:忽略yarn-error.log和.pnpm-debug.log(#14925) (Nitin Kumar)3b6cd89事务: 在no-restricted-{imports/modules}规则中添加相对/绝对路径测试 (#14910) (Bryan Mishkin)f984515事务: 在semi中添加关于报告位置的断言 (#14899) (Nitin Kumar)149230c任务:为 Verify Files CI 作业指定 Node 14.x (#14896) (Milos Djermanovic)537cf6a事务: 更新glob-parent(修复 #14879)(#14887) (Nitin Kumar)f7b4a3f任务:将开发依赖更新到最新 (#14624) (薛定谔的猫)
