chore: update maintenance dependencies#1003
Conversation
|
Deployment failed with the following error: Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit |
Walkthrough本次变更用 eslint.config.mjs(Flat Config)替换旧版 .eslintrc.js,升级 ESLint/TypeScript/React 及测试相关依赖版本,调整 tsconfig.json 编译选项与 global.d.ts 类型声明,修正部分 hooks 中 useRef 的类型以兼容 undefined,并更新 dependabot 分组配置与 README 徽标/表格格式。 ChangesESLint/TypeScript 工具链迁移
Estimated code review effort: 3 (Moderate) | ~25 minutes CI 配置与文档调整
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
There was a problem hiding this comment.
Code Review
This pull request updates the project's dependencies to React 19, ESLint 9, and TypeScript 6, introducing a flat ESLint configuration and adding global type definitions. Feedback highlights several critical issues: disabling strict type-checking flags in tsconfig.json reduces type safety; accessing .rules directly on tsEslintPlugin.configs.recommended in eslint.config.mjs fails under v8 (where it is an array), silently disabling TypeScript rules; and declaring Jest globals as any in global.d.ts overrides the strong types provided by @types/jest.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1003 +/- ##
=======================================
Coverage 98.98% 98.98%
=======================================
Files 18 18
Lines 788 788
Branches 228 232 +4
=======================================
Hits 780 780
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
✅ Preview is ready!
↩️ Previous: ⚡️ 🤖 Powered by surge-preview |
|||||||||||||||
|
React Doctor skipped this pull request — it changed no React files. Reviewed by React Doctor for commit |
|
Deployment failed with the following error: Learn More: https://vercel.com/afc163s-projects?upgradeToPro=build-rate-limit |
|
Related to ant-design/ant-design#58514. |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the repo’s maintenance/tooling setup by upgrading core frontend + lint/test dependencies, moving ESLint to flat config (ESLint 9 + typescript-eslint 8 compatibility), and aligning documentation and automation (README + Dependabot) with the updated ecosystem.
Changes:
- Upgrade React/ReactDOM, TypeScript, ESLint, Testing Library, and related typings/lint dependencies.
- Replace legacy
.eslintrc.jswith an ESLint 9 flat config (eslint.config.mjs) and addglobal.d.tsto centralize ambient typings/module declarations. - Minor README tweaks (Ant Design logo link) and Dependabot grouping updates.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Updates TS module/moduleResolution and path mappings; adds global.d.ts to compilation scope. |
| tests/snapshots/overflow.test.tsx.snap | Snapshot header URL update. |
| tests/snapshots/index.test.tsx.snap | Snapshot header URL update. |
| src/hooks/useUpdate.ts | Adjusts useRef typing to align with newer React type definitions. |
| src/hooks/useTouchMove.ts | Adjusts useRef typing to align with newer React type definitions. |
| src/hooks/useIndicator.ts | Adjusts useRef typing to align with newer React type definitions. |
| README.zh-CN.md | Links Ant Design logo to https://ant.design and minor formatting cleanup. |
| README.md | Links Ant Design logo to https://ant.design and minor formatting cleanup. |
| package.json | Dependency/tooling upgrades (React 19, TS 6, ESLint 9, testing/lint ecosystem). |
| global.d.ts | Adds global type references and ambient module declarations for build/test typing. |
| eslint.config.mjs | Introduces ESLint flat config with React, Jest, and TypeScript integration. |
| .github/dependabot.yml | Adds grouped Dependabot updates for npm + GitHub Actions. |
| .eslintrc.js | Removes legacy ESLint config file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (3)
eslint.config.mjs (3)
47-49: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win建议改用
eslint-plugin-react-hooksv7 的官方 flat 预设当前手动只开启了
rules-of-hooks与exhaustive-deps两条规则,但eslint-plugin-react-hooks@7.1.1(见 package.json)官方 flat 预设reactHooks.configs.flat.recommended新增了多条 React Compiler 相关规则(如set-state-in-effect、purity、refs、static-components等)。手动列举规则会导致后续新增的推荐规则无法自动生效。♻️ 建议改用官方预设
{ files: ['**/*.{js,jsx,ts,tsx}'], extends: [ js.configs.recommended, react.configs.flat.recommended, react.configs.flat['jsx-runtime'], + reactHooks.configs.flat.recommended, prettier, ], - plugins: { - 'react-hooks': reactHooks, - }, languageOptions: { globals: { ...globals.browser, ...globals.node, }, }, settings: { react: { version: 'detect', }, }, rules: { 'no-async-promise-executor': 'off', 'no-empty-pattern': 'off', 'no-irregular-whitespace': 'off', 'no-prototype-builtins': 'off', 'no-useless-escape': 'off', 'no-extra-boolean-cast': 'off', 'no-undef': 'off', 'no-unused-vars': 'off', 'react/no-find-dom-node': 'off', 'react/display-name': 'off', 'react/no-unknown-property': 'off', 'react/prop-types': 'off', - 'react-hooks/exhaustive-deps': 'warn', - 'react-hooks/rules-of-hooks': 'error', }, },采用官方预设后建议先跑一遍
npm run lint,确认新增规则(尤其是较新的 compiler 相关规则)不会引入大量新告警。Also applies to: 74-75
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@eslint.config.mjs` around lines 47 - 49, The React Hooks ESLint setup is manually enabling only a small subset of rules, so update the eslint config to use reactHooks.configs.flat.recommended from eslint-plugin-react-hooks instead of listing rules individually. Adjust the reactHooks plugin configuration in eslint.config.mjs so the official flat preset drives the rules, and keep the existing plugin wiring compatible with the flat config structure. After the change, run lint via the main config entry to verify the newer compiler-related rules from react-hooks are applied without introducing unexpected failures.
69-69: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win全局关闭了未使用变量检测
no-unused-vars(第69行)与@typescript-eslint/no-unused-vars(第87行)均被设为'off',意味着整个代码库都不会检测未使用的变量/导入,可能导致死代码逐渐堆积。若这是为了避免迁移初期产生大量告警的临时妥协,建议后续逐步开启(例如配合argsIgnorePattern: '^_'等选项减少误报)。Also applies to: 87-87
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@eslint.config.mjs` at line 69, The lint config is globally disabling unused-variable checks by turning off both no-unused-vars and `@typescript-eslint/no-unused-vars`, which allows dead code and unused imports to slip through. Update the ESLint config to re-enable these rules in a controlled way, using options like argsIgnorePattern: '^_' or similar suppression patterns to reduce false positives. Make the change in the main lint configuration entries for no-unused-vars and `@typescript-eslint/no-unused-vars` so the codebase regains unused-variable detection without breaking intended underscore-prefixed parameters.
40-46: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win统一 JSX 运行时配置
eslint.config.mjs启用了react.configs.flat['jsx-runtime'],但tsconfig.json仍是"jsx": "react"。当前.tsx文件基本都手动导入了React,暂时没暴露问题,但后续新增 JSX 文件若漏掉import React,ESLint 就不会提示。建议二选一:改成"react-jsx",或移除jsx-runtime预设。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@eslint.config.mjs` around lines 40 - 46, The JSX runtime settings are inconsistent between eslint.config.mjs and tsconfig.json: the ESLint flat config enables react.configs.flat['jsx-runtime'], while TypeScript still uses the classic React JSX transform. Update the setup in the relevant config symbols (react.configs.flat['jsx-runtime'] in eslint.config.mjs and the jsx option in tsconfig.json) so they agree, either by switching TypeScript to the automatic runtime or by removing the jsx-runtime preset from ESLint.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@eslint.config.mjs`:
- Around line 47-49: The React Hooks ESLint setup is manually enabling only a
small subset of rules, so update the eslint config to use
reactHooks.configs.flat.recommended from eslint-plugin-react-hooks instead of
listing rules individually. Adjust the reactHooks plugin configuration in
eslint.config.mjs so the official flat preset drives the rules, and keep the
existing plugin wiring compatible with the flat config structure. After the
change, run lint via the main config entry to verify the newer compiler-related
rules from react-hooks are applied without introducing unexpected failures.
- Line 69: The lint config is globally disabling unused-variable checks by
turning off both no-unused-vars and `@typescript-eslint/no-unused-vars`, which
allows dead code and unused imports to slip through. Update the ESLint config to
re-enable these rules in a controlled way, using options like argsIgnorePattern:
'^_' or similar suppression patterns to reduce false positives. Make the change
in the main lint configuration entries for no-unused-vars and
`@typescript-eslint/no-unused-vars` so the codebase regains unused-variable
detection without breaking intended underscore-prefixed parameters.
- Around line 40-46: The JSX runtime settings are inconsistent between
eslint.config.mjs and tsconfig.json: the ESLint flat config enables
react.configs.flat['jsx-runtime'], while TypeScript still uses the classic React
JSX transform. Update the setup in the relevant config symbols
(react.configs.flat['jsx-runtime'] in eslint.config.mjs and the jsx option in
tsconfig.json) so they agree, either by switching TypeScript to the automatic
runtime or by removing the jsx-runtime preset from ESLint.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 39731f0a-0ab5-4cb3-b6a3-84b74e9a85d3
⛔ Files ignored due to path filters (2)
tests/__snapshots__/index.test.tsx.snapis excluded by!**/*.snaptests/__snapshots__/overflow.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (11)
.eslintrc.js.github/dependabot.ymlREADME.mdREADME.zh-CN.mdeslint.config.mjsglobal.d.tspackage.jsonsrc/hooks/useIndicator.tssrc/hooks/useTouchMove.tssrc/hooks/useUpdate.tstsconfig.json
💤 Files with no reviewable changes (1)
- .eslintrc.js

Summary
Test Plan
Summary by CodeRabbit
新功能
文档
修复
Chores