ESLint v10.0.0-alpha.1 已发布

我们刚刚发布了 ESLint v10.0.0-alpha.1,这是 ESLint 的一次重大版本升级。此次发布增加了一些新功能,并修复了前一版本中发现的几个错误。此次发布还有一些破坏性更改,因此请仔细阅读以下内容。

亮点

🌐 Highlights

此版本的 ESLint 尚未准备好用于生产环境,提供此版本是为了在发布最终版本之前收集社区的反馈。如果你遇到任何问题或有任何反馈,请通过在我们的 GitHub 仓库 创建问题告诉我们。

🌐 This version of ESLint is not ready for production use and is provided to gather feedback from the community before releasing the final version. Please let us know if you having any problems or feedback by creating issues on our GitHub repo.

此版本的大部分亮点都是重大更改,并在迁移指南中有更详细的讨论。下面是重大更改的摘要。(不太重要的更改包含在迁移指南中。)

🌐 Most of the highlights of this release are breaking changes, and are discussed further in the migration guide. There are summaries of the significant changes below. (Less significant changes are included in the migration guide.)

此 ESLint 预发布版本有一个单独的文档部分

🌐 This prerelease version of ESLint has a separate documentation section.

已移除已弃用的 SourceCode 方法

🌐 Removed deprecated SourceCode methods

以下 SourceCode 方法不再可用:

🌐 The following SourceCode methods are no longer available:

  • getTokenOrCommentBefore() - 改用带有 { includeComments: true } 选项的 getTokenBefore()
  • getTokenOrCommentAfter() - 改用带有 { includeComments: true } 选项的 getTokenAfter()
  • isSpaceBetweenTokens() - 请改用 isSpaceBetween()
  • getJSDocComment() - 无替换

尚未更新其代码的插件用户可以在此期间使用@eslint/compat工具。

🌐 Users of plugins that haven’t updated their code yet can use the @eslint/compat utility in the meantime.

正在安装

🌐 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@10.0.0-alpha.1 --save-dev

迁移指南

🌐 Migration Guide

由于有很多变化,我们创建了一个 迁移指南,详细描述了重大更改以及你应该采取的应对步骤。我们预计大多数用户应该能够在不更改构建的情况下升级,但如果遇到问题,迁移指南应该是一个有用的资源。

🌐 As there are a lot of changes, we’ve created a migration guide describing the breaking 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

  • fa31a60 增强功能!: 将 name 添加到配置 (#20015) (Kirk Waiblinger)
  • 3383e7e 修复!: 移除已弃用的 SourceCode 方法 (#20137) (Pixel998)
  • 501abd0 重大更新!: 将依赖 minimatch 更新到 v10 (#20246) (renovate[bot])
  • ca4d3b4 修复!: 对有效测试用例的更严格规则测试断言 (#20125) (唯然)

特性

🌐 Features

文档

🌐 Documentation

杂项

🌐 Chores

  • 0b14059 事务:更新 package.json 以适配 @eslint/js 版本发布(Jenkins)
  • d6e7bf3 ci:将 actions/checkout 从 5 升级到 6 (#20350) (dependabot[bot])
  • 139d456 事务: 要求规则文档中必须的标题 (#20347) (Milos Djermanovic)
  • 3b0289c 事务: 移除未使用的 .eslintignore 和测试夹具 (#20316) (Pixel998)
  • a463e7b 事务:将依赖 js-yaml 更新到 v4 [安全] (#20319) (renovate[bot])
  • ebfe905 事务: 从 eslint-config-eslint 中移除冗余规则 (#20327) (Milos Djermanovic)
  • 88dfdb2 测试:为消息占位符插值添加回归测试 (#20318) (fnx)
  • 6ed0f75 事务:在 eslint-config-eslint 中跳过类型检查 (#20323) (Francesco Trotta)

最新的 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 的一次小版本升级。此版本添加了一些新功能,并修复了上一版本中发现的几个错误。