ESLint v8.45.0 发布

我们刚刚发布了 ESLint v8.45.0,这是 ESLint 的一次小版本升级。此版本添加了一些新功能,并修复了上一版本中发现的几个错误。

亮点

🌐 Highlights

以下是此版本中的一些重要变化。

🌐 Here are some of the important changes in this release.

导出新的 LegacyESLint

🌐 Exporting of new LegacyESLint class

随着我们继续向扁平配置系统过渡,我们一直在与集成商合作,以了解如何最好地帮助他们也进行过渡。虽然我们提供了 FlatESLint 类,以便集成在系统设置为默认之前开始使用扁平配置系统,但我们发现我们最初的计划(在 v9.0.0 中用 FlatESLint 替换 ESLint)会导致集成在过渡期间无法支持 eslintrc。

🌐 As we continue our transition to the flat config system, we’ve been working with integrators to understand how best to help them transition as well. While we provided the FlatESLint class to allow integrations to start using the flat config system before it’s set to default, we discovered that our original plan (replace ESLint with FlatESLint in v9.0.0) would have left integrations unable to support eslintrc during the transition.

为了解决这个问题,我们将 LegacyESLint 类作为 /use-at-your-own-risk 的导出添加进来。FlatESLintLegacyESLint 都将在 v9.0.0 生命周期中可用,允许集成者继续支持两种配置格式。你可以像这样使用这些类:

🌐 To fix this, we added the LegacyESLint class as an export from /use-at-your-own-risk. Both FlatESLint and LegacyESLint will be available through the v9.0.0 lifecycle, allowing integrators to continue to support both config formats. You can use these classes like this:

const { FlatESLint, LegacyESLint } = require("eslint/use-at-your-own-risk"); 

如果你在集成中使用 ESLint 类,最好将其切换为 LegacyESLint,以便在今年晚些时候发布 v9.0.0 时使升级尽可能顺利。

🌐 If you are using the ESLint class in your integration, it’s a good idea to switch that to LegacyESLint to make the upgrade to v9.0.0 as smooth as possible when it is released later this year.

计划是在 v10.0.0 中移除 FlatESLintLegacyESLint 类。

🌐 The plan is to remove both FlatESLint and LegacyESLint classes in v10.0.0.

新配置迁移指南

🌐 New configuration migration guide

我们已经发布了一份新的配置迁移指南,以帮助你将配置从 eslintrc 转换为扁平配置格式。扁平配置现在被认为功能已完整,在 v9.0.0 版本将其设为默认之前,现在是开始切换的好时机。本指南将带你逐步了解 eslintrc 文件的各个部分,并展示如何将它们转换为扁平配置。

🌐 We’ve published a new Configuration Migration Guide to help you make the switch from eslintrc to flat config formats. Flat config is now considered feature complete and it’s a good time to start switching over before flat config becomes the default in v9.0.0. This guide walks you through the various sections of your eslintrc file and shows how to convert them to flat config.

我们感谢那些率先使用新配置系统的用户,他们提供的反馈构成了这本新指南的核心内容。

🌐 We’re grateful for the early adopters of the new config system who provided the feedback that makes up the core of this new guide.

特性

🌐 Features

  • cdd063c 功能:在不支持的 API 中公开 LegacyESLint (#17341) (Nicholas C. Zakas)
  • d34abe5 功能:修复 else-if 的 缩进 规则 (#17318) (Milos Djermanovic)

错误修复

🌐 Bug Fixes

文档

🌐 Documentation

  • 89f3225 文档:为正确和错误的代码块添加 playground 链接 (#17306) (Josh Goldberg ✨)
  • f8892b5 文档:扩展规则选项模式文档 (#17198) (Matt Wilkinson)
  • 8bcbf11 文档:配置迁移指南 (#17230) (Ben Perlmutter)
  • bb30908 文档:更新自述文件(GitHub Actions 机器人)
  • 84d243b 文档:更新自述文件(GitHub Actions 机器人)
  • b762632 文档:更新自述文件(GitHub Actions 机器人)
  • 138c096 文档:用数组解构增加更多 prefer-destructuring 示例 (#17330) (Milos Djermanovic)
  • 1fc50a8 文档:max-len 规则 codetabWidth 作为位置参数 (#17331) (Jesús Leganés-Combarro)

杂项

🌐 Chores

  • 68f63d7 事务: package.json 更新 @eslint/js 版本发布 (ESLint Jenkins)
  • 5ca9b4d 杂务: 更新 eslint-config-eslint 导出 (#17336) (Milos Djermanovic)
  • 7bf2e86 杂项:移除未使用的依赖 (#17352) (Percy Ma)
  • c6f8cd0 杂务: 从 FlatESLint 私有成员中移除 defaultIgnores (#17349) (Francesco Trotta)
  • 0052374 杂务: 将 jsdoc 设置移到 eslint-config-eslint (#17338) (唯然)

最新的 ESLint 新闻、案例研究、教程和资源。

ESLint v10.3.0 发布
1 min read

ESLint v10.3.0 发布

我们刚刚发布了 ESLint v10.3.0,这是 ESLint 的一次小版本升级。此版本添加了一些新功能,并修复了上一版本中发现的几个错误。

ESLint v10.2.1 发布
1 min read

ESLint v10.2.1 发布

我们刚刚发布了 ESLint v10.2.1,这是 ESLint 的一个补丁版本升级。本次发布修复了上一版本中发现的几个错误。

ESLint v10.2.0 发布
2 min read

ESLint v10.2.0 发布

我们刚刚发布了 ESLint v10.2.0,这是 ESLint 的一次小版本升级。此版本添加了一些新功能,并修复了上一版本中发现的几个错误。