chore: update maintenance dependencies#709
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(迁移至 Flat Config)、React、TypeScript 及测试相关依赖版本,调整了 tsconfig 编译选项,新增全局类型声明文件补充,为 Dependabot 更新配置新增分组规则,并更新了 README 顶部徽标为可点击链接。 Changes工具链升级与类型基础设施
Estimated code review effort: 3 (Moderate) | ~25 minutes 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 |
|
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 the project's dependencies to React 19, ESLint 9, and TypeScript 6, introducing several configuration files to support the transition. Feedback on these changes highlights several critical issues: multiple non-existent dependency versions are specified in package.json which will cause installation failures; strict type-checking has been disabled in tsconfig.json, reducing type safety; react and react-dom are fragilely monkey-patched to restore deprecated APIs; Jest globals are typed as any, overriding proper types; and a complex runtime normalization is used in ESLint config to bridge legacy configurations. It is recommended to use valid dependency versions, maintain strict TypeScript checks, adopt idiomatic React 19 APIs, leverage proper Jest types, and fully migrate to ESLint Flat Config.
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 |
|||||||||||||||
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@global.d.ts`:
- Around line 58-65: The Jest globals in the test type declarations are being
redefined as any, which overrides the existing typed globals from Jest/jest-dom.
Remove the manual declare const entries for describe, it, test, beforeEach,
afterEach, beforeAll, afterAll, and expect from global.d.ts so the project uses
the framework-provided typings directly and preserves correct matcher and
callback signatures.
🪄 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: 8e6e3a59-10a2-4fb3-a45a-acbc338a5ae8
📒 Files selected for processing (8)
.github/dependabot.ymlREADME.mdREADME.zh-CN.mdeslint.config.mjsglobal.d.tspackage.jsonreact-compat.d.tstsconfig.json
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #709 +/- ##
=======================================
Coverage 99.69% 99.69%
=======================================
Files 4 4
Lines 329 329
Branches 151 151
=======================================
Hits 328 328
Misses 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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`:
- Around line 14-20: 仓库级的 TypeScript 严格检查被全局关闭了,导致 `npm run tsc`
和生成的声明类型都失去关键校验。请在 `tsconfig.json` 中移除对 `strict` 及其核心子项(如
`noImplicitAny`、`strictNullChecks`、`strictFunctionTypes`、`strictBindCallApply`、`strictPropertyInitialization`、`noImplicitThis`)的整体禁用,改为仅对确实不兼容的项做最小范围豁免,并保持
`declaration` 输出时的类型安全。
🪄 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: 98d9eb4c-2d38-47d6-8b73-c59b775b8b6f
📒 Files selected for processing (4)
.eslintrc.jseslint.config.mjsglobal.d.tstsconfig.json
💤 Files with no reviewable changes (1)
- global.d.ts
|
React Doctor skipped this pull request — it changed no React files. Reviewed by React Doctor for commit |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 18-25: The current `recommendedTsRules` allowlist in
`eslint.config.mjs` only preserves TypeScript rules from
`tsEslintPlugin.configs.recommended`, so it drops local `@typescript-eslint`
overrides from `.eslintrc.js` such as disabled rules. Update the flat config
generation to also include the repo’s explicit `@typescript-eslint/*` overrides,
either by merging those overrides into the allowlist or by applying them after
`compat.config(...)`. Keep the fix centered around `recommendedTsRules`, the
`tsEslintPlugin.configs.recommended` extraction, and the final config assembly
so locally disabled rules are not lost.
🪄 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: c2466f51-21b4-4780-acc6-2e105e93352c
📒 Files selected for processing (3)
eslint.config.mjspackage.jsonreact-compat.d.ts
💤 Files with no reviewable changes (1)
- react-compat.d.ts
🚧 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.
🧹 Nitpick comments (1)
eslint.config.mjs (1)
83-93: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value手动重建
@typescript-eslintplugin 是必要的,但建议为noopRule替换consistent-type-exports加注释。经查证,ESLint Flat Config 在同一批命中文件的多个配置对象中重复声明同名 plugin(非同一引用)会抛出
Cannot redefine plugin错误,因此这里只保留一份手工构造的@typescript-eslintplugin、并让normalizeConfig剥离旧配置里自带的 plugin 声明,是规避该限制的合理做法。不过用
noopRule直接替换consistent-type-exports的规则实现(而不是在文件末尾像另外三条规则一样直接'off')是一种不常见的手法,缺少注释说明动机,容易被后续维护者误认为多余代码而移除。建议补充一行注释说明原因(例如兼容性/已知问题),以避免误删。📝 建议补充说明性注释
plugins: { '`@typescript-eslint`': { ...tsEslintPlugin, rules: { ...tsEslintPlugin.rules, + // 该规则与当前 setup 不兼容,用 no-op 实现屏蔽而非直接 off, + // 以避免上游 extends 中不同层级重新启用该规则。 'consistent-type-exports': noopRule, }, }, },另外需确认:若任一被展开的旧配置层给
'@typescript-eslint/consistent-type-exports'传入了规则选项(如['error', { fixMixedExportsWithInlineTypeSpecifier: true }]),noopRule.meta.schema为空数组会导致 schema 校验失败。目前npm run 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 83 - 93, The manual rebuild of the `@typescript-eslint` plugin is correct, but the noopRule replacement for consistent-type-exports in eslint.config.mjs should be documented so it is not mistaken for dead code. Add a brief explanatory comment near the plugin construction/normalizeConfig setup that references the intentional compatibility workaround for consistent-type-exports and the known Flat Config plugin redefinition issue. If you touch this area, keep the `@typescript-eslint` plugin rebuild and normalizeConfig behavior intact, and make sure any future rule options for consistent-type-exports are still considered against noopRule.meta.schema.
🤖 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 83-93: The manual rebuild of the `@typescript-eslint` plugin is
correct, but the noopRule replacement for consistent-type-exports in
eslint.config.mjs should be documented so it is not mistaken for dead code. Add
a brief explanatory comment near the plugin construction/normalizeConfig setup
that references the intentional compatibility workaround for
consistent-type-exports and the known Flat Config plugin redefinition issue. If
you touch this area, keep the `@typescript-eslint` plugin rebuild and
normalizeConfig behavior intact, and make sure any future rule options for
consistent-type-exports are still considered against noopRule.meta.schema.
|
Related to ant-design/ant-design#58514. |
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s maintenance/tooling dependencies and aligns configuration/docs to support newer React/TypeScript/ESLint ecosystems, including moving to ESLint’s flat config format and improving README branding links.
Changes:
- Upgrades core frontend/tooling deps (React/React DOM, TypeScript, ESLint, Testing Library, types, lint tooling).
- Migrates ESLint configuration from legacy
.eslintrc.jstoeslint.config.mjs(flat config) and adds global ambient typings. - Updates README (EN/ZH) Ant Design logo to link to https://ant.design and refreshes Jest snapshot header links.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tsconfig.json |
Updates TS module resolution/settings and adjusts path mapping/includes for the upgraded toolchain. |
eslint.config.mjs |
Introduces ESLint 9 flat config with React/TS/Jest presets and project-service parsing. |
.eslintrc.js |
Removes legacy ESLint config in favor of flat config. |
package.json |
Bumps and adds devDependencies for React/TS/ESLint/testing/linting ecosystem updates. |
global.d.ts |
Adds global type references and ambient module declarations to reduce TS friction in the toolchain. |
.github/dependabot.yml |
Enables grouped Dependabot updates for npm and GitHub Actions. |
README.md |
Wraps Ant Design logo with a link to https://ant.design. |
README.zh-CN.md |
Wraps Ant Design logo with a link to https://ant.design. |
tests/__snapshots__/simple.test.tsx.snap |
Updates Jest snapshot header URL. |
tests/__snapshots__/options.test.tsx.snap |
Updates Jest snapshot header URL. |
tests/__snapshots__/index.test.tsx.snap |
Updates Jest snapshot header URL. |
tests/__snapshots__/demo.test.tsx.snap |
Updates Jest snapshot header URL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9cdde3e to
1bcfb28
Compare

Summary
Test Plan
Summary by CodeRabbit
新功能
文档
测试与配置