chore: update maintenance dependencies#1235
Conversation
|
Deployment failed with the following error: Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough本次变更升级了 ESLint/TypeScript/React 相关开发依赖,迁移 ESLint 配置为 Flat Config,调整 TypeScript 编译选项,新增全局类型声明,并更新 README 徽标展示与 Dependabot 分组规则。 Changes工具链升级与类型修复
文档与 CI 配置微调
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Code Review
This pull request upgrades the project to React 19 and TypeScript 6, introduces an ESLint flat configuration, and adds type compatibility declarations. While these changes facilitate the upgrade, several issues were identified regarding type safety and configuration. Specifically, disabling strict type-checking flags in tsconfig.json and globally overriding standard React types in react-compat.d.ts reduces codebase robustness and can cause type conflicts. Additionally, declaring test globals as any in global.d.ts overrides strongly-typed Jest definitions, a redundant type cast was found in legacyUtil.ts, and the custom ESLint rule filtering logic may silently discard intended TypeScript rules.
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.
|
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. |
✅ Preview is ready!
↩️ Previous: ⚡️ 🤖 Powered by surge-preview |
|||||||||||||||
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1235 +/- ##
=======================================
Coverage 99.44% 99.44%
=======================================
Files 31 31
Lines 1271 1271
Branches 466 444 -22
=======================================
Hits 1264 1264
Misses 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…nance-deps # Conflicts: # tests/__snapshots__/ssr.test.tsx.snap
|
Related to ant-design/ant-design#58514. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
eslint.config.mjs (1)
93-99: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value全局关闭
no-unused-vars会削弱死代码检测能力。该规则被完全关闭(而不仅是针对迁移期的例外文件),后续新增代码中的未使用变量将不再被 lint 捕获。如果这只是过渡期的临时放宽,建议后续考虑仅在受影响文件/规则粒度上关闭,而不是全局禁用。
🤖 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 93 - 99, The global disable of '`@typescript-eslint/no-unused-vars`' in eslint.config.mjs weakens dead-code detection for all new code. Update the config so the exception is scoped only to the migration-affected files or a narrower override block, and keep the rule enabled elsewhere; use the existing override object in the ESLint config as the place to limit this exception.src/utils/warningPropsUtil.ts (1)
119-131: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value类型标注不一致:
subNode使用裸React.ReactElement而非React.ReactElement<any>。同一函数中 Line 120 对
node使用了React.ReactElement<any>,但 Line 121 的subNode参数仍用裸React.ReactElement。由于该回调内只访问了subNode.type,未访问.props,目前不会引发实际类型问题,但建议保持写法一致,便于后续维护。♻️ 建议统一写法
- ).every((subNode: React.ReactElement) => { + ).every((subNode: React.ReactElement<any>) => {🤖 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 `@src/utils/warningPropsUtil.ts` around lines 119 - 131, The callback in `warningPropsUtil` uses inconsistent React element typing: `node` is annotated as `React.ReactElement<any>` while `subNode` is still a bare `React.ReactElement`. Update the `every` callback’s `subNode` annotation to match the surrounding typing style used in `toNodeArray`/`node` so the generics are consistent and the code stays easier to maintain.
🤖 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.
Inline comments:
In `@tsconfig.json`:
- Line 14: The tsconfig strict setting is being disabled globally, which masks
the type-safety improvements this PR is meant to address. Remove the global
strict: false change and keep strict mode enabled in tsconfig.json; then fix the
specific React 19/TypeScript upgrade errors in the affected symbols such as
BaseSelect and legacyUtil with targeted type adjustments or localized
ts-expect-error usage instead of weakening the whole repository.
---
Nitpick comments:
In `@eslint.config.mjs`:
- Around line 93-99: The global disable of '`@typescript-eslint/no-unused-vars`'
in eslint.config.mjs weakens dead-code detection for all new code. Update the
config so the exception is scoped only to the migration-affected files or a
narrower override block, and keep the rule enabled elsewhere; use the existing
override object in the ESLint config as the place to limit this exception.
In `@src/utils/warningPropsUtil.ts`:
- Around line 119-131: The callback in `warningPropsUtil` uses inconsistent
React element typing: `node` is annotated as `React.ReactElement<any>` while
`subNode` is still a bare `React.ReactElement`. Update the `every` callback’s
`subNode` annotation to match the surrounding typing style used in
`toNodeArray`/`node` so the generics are consistent and the code stays easier to
maintain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c8cbda6e-b762-4f1f-b64c-e324bc764f7d
⛔ Files ignored due to path filters (6)
tests/__snapshots__/Combobox.test.tsx.snapis excluded by!**/*.snaptests/__snapshots__/Multiple.test.tsx.snapis excluded by!**/*.snaptests/__snapshots__/OptionList.test.tsx.snapis excluded by!**/*.snaptests/__snapshots__/Select.test.tsx.snapis excluded by!**/*.snaptests/__snapshots__/Tags.test.tsx.snapis excluded by!**/*.snaptests/__snapshots__/ssr.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (12)
.github/dependabot.ymlREADME.mdREADME.zh-CN.mdeslint.config.mjsglobal.d.tspackage.jsonsrc/BaseSelect/index.tsxsrc/Select.tsxsrc/hooks/useRefFunc.tssrc/utils/legacyUtil.tssrc/utils/warningPropsUtil.tstsconfig.json
There was a problem hiding this comment.
Pull request overview
This PR updates the repo’s maintenance/tooling stack (React/TypeScript/ESLint/Jest ecosystem), adds ESLint flat-config support for ESLint 9 + TypeScript ESLint 8, and performs the related config/type/snapshot adjustments needed to keep the project building and linting cleanly.
Changes:
- Update core dev dependencies (React/ReactDOM, TypeScript, ESLint, Testing Library, types, lint tooling).
- Add
eslint.config.mjsusingFlatCompatto reuse the existing.eslintrc.jsunder ESLint 9. - Adjust TS config and internal typings (plus snapshot updates) to align with updated toolchain/runtime output.
Reviewed changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Updates TS compiler options (module resolution/paths/module) and includes global.d.ts. |
| package.json | Bumps and adds dev tooling dependencies for ESLint 9, TS ESLint 8, React 19, etc. |
| eslint.config.mjs | Introduces ESLint flat config compatibility layer over existing .eslintrc.js. |
| global.d.ts | Adds global type references and ambient module declarations for tests/docs/build. |
| .github/dependabot.yml | Groups Dependabot updates for npm and GitHub Actions. |
| README.md | Links Ant Design ecosystem logo to https://ant.design. |
| README.zh-CN.md | Links Ant Design ecosystem logo to https://ant.design. |
| src/utils/warningPropsUtil.ts | Refines React element typing for OptGroup children validation. |
| src/utils/legacyUtil.ts | Refines React element typing when converting children to option data. |
| src/SelectInput/Content/index.tsx | Refactors forwardRef usage to a named function + wrapped export. |
| src/Select.tsx | Makes useRef initialization explicit for updated TS/React typings. |
| src/hooks/useRefFunc.ts | Initializes useRef with the callback to satisfy stricter typings. |
| src/BaseSelect/index.tsx | Uses React.ReactElement return types for input element getters. |
| tests/snapshots/Combobox.test.tsx.snap | Snapshot header URL update. |
| tests/snapshots/Multiple.test.tsx.snap | Snapshot header URL update. |
| tests/snapshots/OptionList.test.tsx.snap | Snapshot header URL update. |
| tests/snapshots/Select.test.tsx.snap | Snapshot header URL update. |
| tests/snapshots/Tags.test.tsx.snap | Snapshot header URL update. |
| tests/snapshots/ssr.test.tsx.snap | Snapshot header URL update + SSR output casing change (readOnly). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
eslint.config.mjs (1)
30-40: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value建议为被丢弃的规则增加可见性日志
dropUnsupportedRules静默过滤掉不受支持的规则,没有任何日志输出。当未来@typescript-eslint/@babel插件版本升级导致更多规则被重命名或移除时,被静默丢弃的规则很难被察觉,可能导致 lint 覆盖范围在不知不觉中收窄。♻️ 建议增加调试日志
function dropUnsupportedRules(config) { if (!config.rules) { return config; } return { ...config, rules: Object.fromEntries( - Object.entries(config.rules).filter(([ruleName]) => supportRule(ruleName)), + Object.entries(config.rules).filter(([ruleName]) => { + const supported = supportRule(ruleName); + if (!supported) { + console.warn(`[eslint.config.mjs] Dropping unsupported rule: ${ruleName}`); + } + return supported; + }), ), }; }🤖 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 30 - 40, dropUnsupportedRules currently filters out unsupported ESLint rules silently, so add a debug/diagnostic log when rules are removed. Update the dropUnsupportedRules function to detect the filtered-out rule names while preserving its existing behavior, and emit a concise message that includes the discarded rule identifiers and the config context. Keep the change localized to dropUnsupportedRules in eslint.config.mjs so future `@typescript-eslint/`@babel rule changes are visible during config loading.
🤖 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 30-40: dropUnsupportedRules currently filters out unsupported
ESLint rules silently, so add a debug/diagnostic log when rules are removed.
Update the dropUnsupportedRules function to detect the filtered-out rule names
while preserving its existing behavior, and emit a concise message that includes
the discarded rule identifiers and the config context. Keep the change localized
to dropUnsupportedRules in eslint.config.mjs so future `@typescript-eslint/`@babel
rule changes are visible during config loading.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 66c26695-41b5-4ef5-a130-5ef311673ba4
📒 Files selected for processing (2)
eslint.config.mjssrc/SelectInput/Content/index.tsx
There was a problem hiding this comment.
🧹 Nitpick comments (1)
eslint.config.mjs (1)
34-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winManual react-hooks rule wiring skips the plugin's official recommended preset.
eslint-plugin-react-hooks@7.1.1shipsreactHooks.configs.flat.recommended(andrecommended-latest), which bundles the two rules configured here plus additional hook-correctness checks (e.g.refs,static-components,use-memo) that are useful independent of adopting the React Compiler. Consider using the plugin'sextendsentry instead of manually re-declaring the plugin and two rules, for better long-term alignment with upstream defaults.♻️ Possible alternative
extends: [ js.configs.recommended, ...tseslint.configs.recommended, react.configs.flat.recommended, react.configs.flat['jsx-runtime'], + reactHooks.configs.flat.recommended, prettier, ], - plugins: { - 'react-hooks': reactHooks, - }, ... rules: { ... - 'react-hooks/exhaustive-deps': 'warn', - 'react-hooks/rules-of-hooks': 'error', },Verify that enabling the full recommended set doesn't introduce a large number of new lint failures before adopting, since some of the additional rules are React Compiler diagnostics that may not have been vetted against this codebase.
🤖 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 34 - 60, The React Hooks ESLint setup is manually re-declaring only two rules, so switch the configuration in eslint.config.mjs to use reactHooks.configs.flat.recommended (or recommended-latest) instead of wiring react-hooks/rules-of-hooks and react-hooks/exhaustive-deps by hand. Keep the existing reactHooks plugin registration and other project-specific rule overrides, but adopt the plugin’s official preset so additional hook correctness checks are enabled consistently. Verify the full preset doesn’t introduce unexpected lint failures before merging.
🤖 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 34-60: The React Hooks ESLint setup is manually re-declaring only
two rules, so switch the configuration in eslint.config.mjs to use
reactHooks.configs.flat.recommended (or recommended-latest) instead of wiring
react-hooks/rules-of-hooks and react-hooks/exhaustive-deps by hand. Keep the
existing reactHooks plugin registration and other project-specific rule
overrides, but adopt the plugin’s official preset so additional hook correctness
checks are enabled consistently. Verify the full preset doesn’t introduce
unexpected lint failures before merging.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1c1a880b-1236-478f-ad2c-f7fe06b10cfa
📒 Files selected for processing (3)
.eslintrc.jseslint.config.mjspackage.json
💤 Files with no reviewable changes (1)
- .eslintrc.js

Summary
Test Plan
Summary by CodeRabbit