
亮点
🌐 Highlights
更精确的问题位置
🌐 More precise problem locations
ESLint v9.39.0 引入了改进,可以缩小某些规则违规的高亮位置。通过减少不必要的高亮显示,这些变化降低了视觉噪音,使代码中的问题更容易被发现和修复。
🌐 ESLint v9.39.0 introduces improvements that narrow the highlighted locations for certain rule violations. By reducing unnecessary highlighting, these changes cut down on visual noise and make issues in code easier to spot and fix.
以下是新内容:
🌐 Here’s what’s new:
complexity: 在 v9.38.0 中,此规则已更新为仅高亮函数的头部,而不是整个函数。在 v9.39.0 中,相同的改进现在也适用于类的静态代码块:仅高亮头部,而不是整个代码块。- **
for-direction:**现在只高亮for循环的头部部分,而不是整个语句。 no-dupe-args: 现在仅高亮函数定义中的参数列表,而不是整个函数。no-dupe-class-members: 现在仅高亮重复成员的标识符,而不是它们的完整定义。
统一规则性能报告
🌐 Unified rule performance report
当设置 TIMING 环境变量并且 ESLint 以多线程模式使用 --concurrency 选项运行时,输出现在包括一个统一的性能报告。该合并报告汇总了所有线程的计时数据,取代了之前打印多个单独报告的行为。
🌐 When the TIMING environment variable is set and ESLint runs in multithread mode with the --concurrency option, the output now includes a single, unified performance report. This consolidated report aggregates timing data from all threads, replacing the previous behavior of printing multiple separate reports.
示例:
🌐 Example:
$ TIMING=1 npx eslint --concurrency=2
Rule | Time (ms) | Relative
:-----------------------------------|----------:|--------:
jsdoc/valid-types | 484.199 | 5.1%
n/no-extraneous-require | 431.187 | 4.5%
jsdoc/check-access | 375.205 | 3.9%
jsdoc/check-values | 323.224 | 3.4%
jsdoc/check-types | 308.546 | 3.2%
jsdoc/check-tag-names | 305.308 | 3.2%
n/no-unsupported-features/es-syntax | 275.097 | 2.9%
expect-type/expect | 257.434 | 2.7%
jsdoc/check-alignment | 255.678 | 2.7%
jsdoc/require-property-type | 250.951 | 2.6%
特性
🌐 Features
cc57d87功能:在no-dupe-class-members中将错误位置更新为键 (#20259) (Tanuj Kanti)126552f功能:更新for-direction和no-dupe-args中的错误位置 (#20258) (Tanuj Kanti)167d097功能:更新complexity规则,仅高亮静态块标题 (#20245) (jaymarvelz)
错误修复
🌐 Bug Fixes
15f5c7c修复:将遍历转发step.args到访问者 (#20253) (jaymarvelz)5a1a534修复:在 object-shorthand 规则中允许 JSDoc 注释 (#20167) (Nitin Kumar)e86b813修复:从 @eslint/core 使用更多类型 (#20257) (Nicholas C. Zakas)927272d修复:纠正Scope类型定义 (#20198) (jaymarvelz)37f76d9修复:对 Program 节点使用AST.Program类型 (#20244) (Francesco Trotta)ae07f0b修复:统一并发 linting 的时间报告 (#20188) (jaymarvelz)b165d47修复:纠正Rule类型定义 (#20199) (jaymarvelz)fb97cda修复:改进建议中缺少修复功能时的错误信息 (#20218) (jaymarvelz)
文档
🌐 Documentation
d3e81e3文档:始终建议包括一个 files 属性 (#20158) (Percy Ma)0f0385f文档:使用一致的命名建议 (#20250) (Alex M. Spieslechner)a3b1456文档:更新自述文件(GitHub Actions 机器人)cf5f2dd文档:修复no-useless-constructor的正确标签 (#20255) (Tanuj Kanti)10b995c文档:在no-use-before-define中为nofunc添加 TS 选项和示例 (#20249) (Tanuj Kanti)2584187文档:删除评论中的重复词 (#20242) (reddaisyy)637216b文档:更新 CLI 标志迁移说明 (#20238) (jaymarvelz)e7cda3b文档:更新自述文件(GitHub Actions 机器人)7b9446f文档:在功能标志页面处理空的标志部分 (#20222) (sethamus)
杂项
🌐 Chores
dfe3c1b事务:将@eslint/js版本更新到 9.39.0 (#20270) (Francesco Trotta)2375a6d事务:更新 package.json 以适配 @eslint/js 版本发布(Jenkins)a1f4e52事务: 更新@eslint依赖 (#20265) (Francesco Trotta)c7d3229杂项:将依赖 @eslint/core 更新到 ^0.17.0 (#20256) (renovate[bot])27549bc杂务:更新模糊测试,以防代码示例最小化失败时不报错 (#20252) (Milos Djermanovic)a1370eeci:将 actions/setup-node 从 5 升级到 6 (#20230) (dependabot[bot])9e7fad4工作: 添加脚本以自动生成 eslint:recommended 配置 (#20208) (唯然)
