Skip to content

Conversation

@Sorkai
Copy link
Owner

@Sorkai Sorkai commented Dec 2, 2025

引入 ESLint v9 的 Flat Configuration 系统,替换旧版配置。
更新 ESLint 和 TypeScript ESLint 插件至最新主要版本,以获得最新功能和性能优化。
为 TypeScript 和 Node.js 项目配置推荐规则,并启用类型检查。
调整测试文件中的 require 导入规则,以避免不必要的 linting 错误。

引入 ESLint v9 的 Flat Configuration 系统,替换旧版配置。
更新 ESLint 和 TypeScript ESLint 插件至最新主要版本,以获得最新功能和性能优化。
为 TypeScript 和 Node.js 项目配置推荐规则,并启用类型检查。
调整测试文件中的 `require` 导入规则,以避免不必要的 linting 错误。
Copilot AI review requested due to automatic review settings December 2, 2025 15:54
@Sorkai Sorkai self-assigned this Dec 2, 2025
@Sorkai Sorkai added the dependencies Pull requests that update a dependency file label Dec 2, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the project's ESLint infrastructure from v8 to v9, adopting the new Flat Config format. The change modernizes the linting setup with updated TypeScript ESLint plugins (from v6 to v8), introduces a new eslint.config.cjs configuration file, and updates related dependencies. However, there's a concerning TypeScript version downgrade that should be addressed.

Key Changes

  • ESLint upgraded from ^8.47.0 to ^9.39.1
  • TypeScript ESLint plugin/parser upgraded from ^6.4.1 to ^8.48.1
  • New Flat Config format implemented in eslint.config.cjs

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
package.json Dependency version updates with a problematic TypeScript downgrade
package-lock.json Lock file updates reflecting new dependency versions and their transitive dependencies
eslint.config.cjs New ESLint v9 Flat Config implementation with TypeScript support and test file rule adjustments

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

sourceType: 'module',
tsconfigRootDir: __dirname,
// 若启用需要类型信息的规则,请保留 project。若不需要,可注释掉以提升性能。
project: ['./tsconfig.json']
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment claims "若启用需要类型信息的规则,请保留 project。若不需要,可注释掉以提升性能。" (If enabling rules requiring type information, keep project. If not needed, comment out to improve performance), but the project configuration is uncommented. This creates ambiguity. Either enable type-checking rules (line 54) or remove the project configuration for better linting performance, as mentioned in the comment itself.

Suggested change
project: ['./tsconfig.json']
// project: ['./tsconfig.json']

Copilot uses AI. Check for mistakes.
Sorkai and others added 2 commits December 2, 2025 23:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
在 ESLint 配置中启用 'recommended-requiring-type-checking' 规则,以强制执行更严格的 TypeScript 类型检查。
为有意不处理的异步函数调用添加 'void' 操作符,以符合新的 ESLint 规则(例如,避免未处理的 Promise 警告)。
重构了工具函数 (getAllFileExtensions, directoryHasMatchingFiles),移除了同步操作中不必要的 Promise.all,简化了代码并提高了效率。
@Sorkai
Copy link
Owner Author

Sorkai commented Dec 2, 2025

@copilot 再检查一下

Copy link

Copilot AI commented Dec 2, 2025

@Sorkai I've opened a new pull request, #16, to work on those changes. Once the pull request is ready, I'll request review from you.

[WIP] Upgrade ESLint to v9 and adopt Flat Config
@Sorkai Sorkai merged commit 62a94c2 into main Dec 2, 2025
8 checks passed
@Sorkai Sorkai deleted the chore/eslint-upgrade branch December 2, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants