ESLint v10.6.0 发布

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

亮点

🌐 Highlights

no-constant-binary-expression 中的新选项 checkRelationalComparisons

🌐 New option checkRelationalComparisons in no-constant-binary-expression

ESLint v10.6.0 为 no-constant-binary-expression 规则引入了一个新的选项 checkRelationalComparisons。启用后,该规则会报告使用 <<=>>= 的关系比较,其结果基于它们的字面操作数始终是常量。

🌐 ESLint v10.6.0 introduces a new option checkRelationalComparisons for the no-constant-binary-expression rule. When enabled, the rule reports relational comparisons using <, <=, >, or >= whose result is always constant based on their literal operands.

例如:

🌐 For example:

const value = "a" > "b"; // always `false`
while (0 <= 0) { // always `true`
    /* ... */
}

规则改进

🌐 Rule refinements

以下规则已被调整,以提高正确性并确保在边缘情况下行为更一致或更直观:

🌐 The following rules have been tweaked to improve correctness and ensure more consistent or intuitive behavior in edge cases:

特性

🌐 Features

错误修复

🌐 Bug Fixes

文档

🌐 Documentation

  • a83683d 文档:更新自述文件(GitHub Actions 机器人)
  • f5449f9 文档:记录 RuleT 中 global assertionOptions 的用户空间模式… (#20986) (playgirl)
  • bea49f7 文档:更新自述文件(GitHub Actions 机器人)
  • e5f70f9 文档:更新代码路径图 (#20984) (Tanuj Kanti)
  • 8890c2d 文档:为 MCP 服务器添加 TypeScript 配置指南 (#20796) (Pierluigi Lenoci)
  • 3eb3d9b 文档:更新自述文件(GitHub Actions 机器人)
  • c5bb59c 文档:更新自述文件(GitHub Actions 机器人)
  • eb3c97c 文档:修复 prefer-const 规则描述中的语法错误 (#20983) (lumir)

杂项

🌐 Chores

  • 6a42034 ci:在主分支上运行生态系统测试 (#20891) (sethamus)
  • 3dbacdb ci:将 actions/checkout 从 6 升级到 7 (#21014) (dependabot[bot])
  • c3abfca 任务:在 HTML 格式化程序中修复 JSDoc 参数类型 (#21018) (Minseon Kim)
  • a832320 ci:将生态系统测试拆分为单独的作业 (#21001) (xbinaryx)
  • 27166e7 例行任务:更新生态系统插件 (#21005) (ESLint 机器人)
  • 865d76e ci: 将 pnpm/action-setup 从 6.0.8 更新到 6.0.9 (#20989) (dependabot[bot])
  • 27a88c9 杂务:在根目录中将依赖 markdown-it 更新到 v14 (#20994) (Milos Djermanovic)
  • 970cea6 事务: 将依赖 markdown-it 更新到 v14 (#20993) (Milos Djermanovic)
  • b482120 杂务:将依赖 prettier 更新到 v3.8.4 (#20990) (renovate[bot])
  • 6993fb3 杂项:更新生态系统插件 (#20985) (ESLint 机器人)

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

ESLint v10.8.0 发布
2 min read

ESLint v10.8.0 发布

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

ESLint v9.39.5 发布
1 min read

ESLint v9.39.5 发布

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