chore: update maintenance dependencies#880
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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本次 PR 集中升级了工具链与类型环境,新增 ESLint Flat Config 和全局声明文件,统一了源码与示例中的 ref/回调类型标注,并调整了 Dependabot、README 和测试断言写法。 Changes工具链升级与类型兼容适配
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
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 |
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
|
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 upgrades project dependencies to support React 19 and TypeScript 6, introduces a flat ESLint configuration, and adds compatibility type definitions. However, the changes introduce some type-safety regressions. Specifically, disabling strict compiler flags in tsconfig.json significantly weakens type safety across the codebase, and declaring Jest globals as any in global.d.ts overrides the strongly-typed definitions provided by @types/jest. It is highly recommended to maintain strict type-checking and preserve proper test types.
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.
✅ Preview is ready!
↩️ Previous: ⚡️ 🤖 Powered by surge-preview |
|||||||||||||||
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@eslint.config.mjs`:
- Around line 40-48: The filtering in the eslint config is dropping most
existing `@typescript-eslint` rules from the old eslintrc setup, so keep the
current lint behavior by explicitly carrying those legacy TS rules into the flat
config instead of removing them in the Object.fromEntries/Object.entries filter.
Update the logic around next.rules in eslint.config.mjs, using the existing
recommendedTsRules handling as a base, and add the missing rules such as
`@typescript-eslint/no-empty-interface`,
`@typescript-eslint/consistent-indexed-object-style`,
`@typescript-eslint/switch-exhaustiveness-check`,
`@typescript-eslint/no-parameter-properties`, and
`@typescript-eslint/type-annotation-spacing` so they remain enabled after
migration.
In `@tsconfig.json`:
- Around line 16-22: Keep the TypeScript strictness enabled in tsconfig.json by
preserving strict and removing the broad strict* overrides so npm run tsc
continues to catch regressions, and update the JSX setting from the classic
runtime to the React 19 automatic runtime. Use the tsconfig.json settings around
strict, noImplicitAny, strictNullChecks, strictPropertyInitialization,
strictFunctionTypes, noImplicitThis, and strictBindCallApply, and change the jsx
option to react-jsx while leaving react-compat.d.ts and global.d.ts as type
supplements rather than substitutes for compiler checks.
- Around line 15-24: The tsconfig JSX runtime is still using the classic React
transform, which is incompatible with the React 19 upgrade expectation. Update
the jsx setting in tsconfig.json from the current classic runtime to the
automatic JSX transform, and keep the change limited to the TypeScript config so
the app compiles with React 19 conventions.
🪄 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: 2623c6c3-9f28-4d7f-8cd2-11689792fb31
📒 Files selected for processing (10)
.github/dependabot.ymlREADME.mdREADME.zh-CN.mddocs/examples/customPopupRender.tsxeslint.config.mjsglobal.d.tspackage.jsonreact-compat.d.tssrc/Menu.tsxtsconfig.json
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #880 +/- ##
=======================================
Coverage 99.72% 99.72%
=======================================
Files 26 26
Lines 734 734
Branches 205 205
=======================================
Hits 732 732
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
♻️ Duplicate comments (1)
eslint.config.mjs (1)
18-22: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win不要用
recommended白名单过滤掉旧的 TS 规则覆盖。这里仍然会把
.eslintrc.js里显式关闭的@typescript-eslint/*规则静默丢掉;@typescript-eslint/no-empty-interface、@typescript-eslint/consistent-indexed-object-style、@typescript-eslint/switch-exhaustiveness-check、@typescript-eslint/no-parameter-properties、@typescript-eslint/no-throw-literal、@typescript-eslint/type-annotation-spacing、@typescript-eslint/ban-types都不再随迁移保留。这样compat.config(require('./.eslintrc.js'))和旧配置的契约被打破,npm run lint的结果会和迁移前不一致。更稳妥的做法是保留这些旧的显式 TS 规则覆盖,或只移除plugins而不要按recommended再过滤rules。可选修正
function normalizeConfig(config) { const next = { ...config }; if (next.plugins?.['`@typescript-eslint`']) { next.plugins = { ...next.plugins }; delete next.plugins['`@typescript-eslint`']; } - if (next.rules) { - next.rules = Object.fromEntries( - Object.entries(next.rules).filter(([ruleName]) => { - if (!ruleName.startsWith('`@typescript-eslint/`')) { - return true; - } - - return recommendedTsRules.has(ruleName); - }), - ); - } - return next; }#!/bin/bash set -euo pipefail echo "Legacy TS rule overrides in .eslintrc.js:" rg -n "`@typescript-eslint/`" .eslintrc.js echo echo "Filtering logic in eslint.config.mjs:" sed -n '18,40p' eslint.config.mjsAlso applies to: 38-38
🤖 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 18 - 22, The current recommendedTS whitelist logic in eslint.config.mjs is dropping legacy `@typescript-eslint` rule overrides from compat.config(require('./.eslintrc.js')), so explicitly preserved TS rules from .eslintrc.js are being lost during migration. Update the filtering around recommendedTsRulesConfig/recommendedTsRulesObject/recommendedTsRules so it does not remove old TS rule overrides; either keep the legacy `@typescript-eslint/`* rules from the compat config or only strip plugin entries without re-filtering rules against the recommended set.
🤖 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.
Duplicate comments:
In `@eslint.config.mjs`:
- Around line 18-22: The current recommendedTS whitelist logic in
eslint.config.mjs is dropping legacy `@typescript-eslint` rule overrides from
compat.config(require('./.eslintrc.js')), so explicitly preserved TS rules from
.eslintrc.js are being lost during migration. Update the filtering around
recommendedTsRulesConfig/recommendedTsRulesObject/recommendedTsRules so it does
not remove old TS rule overrides; either keep the legacy `@typescript-eslint/`*
rules from the compat config or only strip plugin entries without re-filtering
rules against the recommended set.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2271fa41-43b5-4b77-a539-77be1c5eac64
📒 Files selected for processing (4)
eslint.config.mjspackage.jsonreact-compat.d.tstests/Collapsed.spec.tsx
💤 Files with no reviewable changes (1)
- react-compat.d.ts
✅ Files skipped from review due to trivial changes (1)
- tests/Collapsed.spec.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- package.json
|
Deployment failed with the following error: Learn More: https://vercel.com/afc163s-projects?upgradeToPro=build-rate-limit |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
eslint.config.mjs (1)
35-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win不要用 no-op 覆盖
@typescript-eslint/consistent-type-exports。 这会让即使显式启用的规则也直接变成空实现,等于静默跳过检查;如果只是为了迁移兼容,保留原插件对象,并在最终rules里显式设为off即可。🤖 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 35 - 38, The current noopRule override effectively disables `@typescript-eslint/consistent-type-exports` by replacing the real rule with an empty implementation. Update the ESLint config to keep the original plugin rule object intact, and instead disable this rule explicitly in the final rules configuration using its rule name so the intent is clear and the check is not silently skipped.
🤖 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 `@package.json`:
- Around line 93-94: The peer dependency ranges for react and react-dom are too
narrow in package.json and should be aligned with the intended React
compatibility. Update the peerDependencies entries so PackageJson declares the
broader React 19 range if no 19.2.7-specific APIs are required, or otherwise
explicitly keep the stricter version only if this release is meant to be a
breaking 19.2.7+ requirement.
In `@README.md`:
- Line 73: The install command in the README is incorrect and should be restored
to the standard npm install command. Update the affected install instructions in
README.md and the matching section in README.zh-CN.md so they use npm install
consistently with the existing Vercel configuration and do not reference ut
install.
In `@README.zh-CN.md`:
- Line 73: The install command shown in the README examples is incorrect and
should be changed back to npm install. Update the installation snippet in the
README.zh-CN.md example, and make sure the matching install example in README.md
uses the same valid command so readers can follow the documented setup
successfully.
---
Nitpick comments:
In `@eslint.config.mjs`:
- Around line 35-38: The current noopRule override effectively disables
`@typescript-eslint/consistent-type-exports` by replacing the real rule with an
empty implementation. Update the ESLint config to keep the original plugin rule
object intact, and instead disable this rule explicitly in the final rules
configuration using its rule name so the intent is clear and the check is not
silently skipped.
🪄 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: e06a83bc-8e2c-4f0f-aeb6-217e70bda280
📒 Files selected for processing (12)
README.mdREADME.zh-CN.mddocs/examples/debug.tsxdocs/examples/items-ref.tsxeslint.config.mjspackage.jsonsrc/Menu.tsxsrc/MenuItem.tsxsrc/SubMenu/PopupTrigger.tsxsrc/SubMenu/index.tsxsrc/hooks/useAccessibility.tstsconfig.json
✅ Files skipped from review due to trivial changes (2)
- src/hooks/useAccessibility.ts
- src/MenuItem.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/Menu.tsx
|
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 (React/TypeScript/ESLint/testing deps) and aligns the codebase with newer type expectations, while also updating documentation and automation for ongoing dependency maintenance.
Changes:
- Upgrades core dev dependencies (React/React DOM, TypeScript, ESLint 9 + flat config, Testing Library, @types/*, etc.).
- Updates TypeScript configuration and adds a global ambient typings file for local type support.
- Minor code/type cleanups (typed refs, small type annotations), plus README and Dependabot configuration updates.
Reviewed changes
Copilot reviewed 22 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Updates TS compiler options (notably module resolution) and include list. |
| package.json | Bumps React/TS/ESLint/testing/lint tooling dependency versions. |
| eslint.config.mjs | Adds ESLint 9 flat config setup to replace legacy .eslintrc. |
| .eslintrc.js | Removes legacy ESLint config. |
| global.d.ts | Adds ambient module declarations and common type references. |
| .github/dependabot.yml | Enables grouped Dependabot updates for npm and GitHub Actions. |
| src/Menu.tsx | Adjusts ref typing and adds explicit element typing in a find callback. |
| src/MenuItem.tsx | Initializes refs with null for updated React typings. |
| src/SubMenu/index.tsx | Initializes refs with null for updated React typings. |
| src/SubMenu/PopupTrigger.tsx | Makes the RAF handle ref explicitly `number |
| src/hooks/useAccessibility.ts | Makes RAF/active key refs explicitly `T |
| src/interface.ts | Updates submenu item typings (notably title). |
| tests/Collapsed.spec.tsx | Formatting-only test adjustments (single-line expectations/events). |
| tests/snapshots/Menu.spec.tsx.snap | Updates snapshot header URL. |
| tests/snapshots/MenuItem.spec.tsx.snap | Updates snapshot header URL. |
| tests/snapshots/Keyboard.spec.tsx.snap | Updates snapshot header URL. |
| tests/snapshots/Options.spec.tsx.snap | Updates snapshot header URL. |
| tests/snapshots/Responsive.spec.tsx.snap | Updates snapshot header URL. |
| tests/snapshots/SubMenu.spec.tsx.snap | Updates snapshot header URL. |
| README.md | Links Ant Design ecosystem logo to https://ant.design. |
| README.zh-CN.md | Links Ant Design ecosystem logo to https://ant.design. |
| docs/examples/items-ref.tsx | Types example refs as HTMLLIElement refs initialized with null. |
| docs/examples/debug.tsx | Types menuRef and initializes with null. |
| docs/examples/customPopupRender.tsx | Adds explicit generics/types for ReactElement parameters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| label?: React.ReactNode; | ||
| title?: string; | ||
| title?: React.ReactNode; | ||
|
|
| parserOptions: { | ||
| projectService: true, | ||
| tsconfigRootDir: import.meta.dirname, | ||
| }, |

Summary
Test Plan
Summary by CodeRabbit
title更名为label。