Skip to content

chore: update maintenance dependencies#1235

Open
afc163 wants to merge 25 commits into
masterfrom
codex/update-maintenance-deps
Open

chore: update maintenance dependencies#1235
afc163 wants to merge 25 commits into
masterfrom
codex/update-maintenance-deps

Conversation

@afc163

@afc163 afc163 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Link the Ant Design ecosystem logo in README files to https://ant.design
  • Update React, React DOM, TypeScript, ESLint, Testing Library, @types/, @typescript-eslint/, lint-staged, and related lint dependencies
  • Add ESLint flat config compatibility for ESLint 9 and TypeScript ESLint 8
  • Use grouped Dependabot updates for npm and GitHub Actions

Test Plan

  • npm run lint
  • npm run tsc

Summary by CodeRabbit

  • 文档
    • 更新 README 顶部生态徽标:英文版本改为点击外链;中文版本补充徽标对齐样式。
  • 改进
    • 更新 TypeScript 与 ESLint 配置、全局类型声明,并扩展对测试文件的代码检查规则。
    • 优化部分组件与工具的 TypeScript 类型定义(如 Select/BaseSelect、hooks 与相关类型处理),提升类型兼容性。

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

本次变更升级了 ESLint/TypeScript/React 相关开发依赖,迁移 ESLint 配置为 Flat Config,调整 TypeScript 编译选项,新增全局类型声明,并更新 README 徽标展示与 Dependabot 分组规则。

Changes

工具链升级与类型修复

Layer / File(s) Summary
依赖版本升级
package.json
新增并升级 ESLint、TypeScript、React 生态相关 devDependencies,移除 @umijs/fabric
ESLint Flat Config 迁移
eslint.config.mjs, .eslintrc.js
新增静态 Flat Config 的主代码、TypeScript 与测试文件配置段,并移除旧的 .eslintrc.js
tsconfig 编译选项调整
tsconfig.json
调整模块解析、模块格式、严格模式、路径映射和 include 范围,并纳入 global.d.ts
全局类型声明补充
global.d.ts
新增 Jest、Node、React、ReactDOM 与测试库类型引用,以及样式、jsonpmoment/locale/zh-cn 的模块声明。
src 类型标注适配
src/BaseSelect/index.tsx, src/Select.tsx, src/hooks/useRefFunc.ts, src/utils/legacyUtil.ts, src/utils/warningPropsUtil.ts
更新 React 相关返回类型、引用初始化和节点断言标注。

文档与 CI 配置微调

Layer / File(s) Summary
README 徽标链接与样式更新
README.md, README.zh-CN.md
顶部徽标新增链接,中文 README 的徽标图片新增垂直对齐样式。
Dependabot 分组配置
.github/dependabot.yml
npmgithub-actions 更新项新增通配符分组规则。

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: zombieJ

Poem

兔子敲键轻轻跳,
ESLint 换了新跑道,
类型声明补得妙,
徽标链接闪闪耀,
合并提交乐逍遥 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次主要变更:维护性依赖与相关工具链升级。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/update-maintenance-deps

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread eslint.config.mjs Outdated
Comment thread src/utils/legacyUtil.ts Outdated
Comment thread global.d.ts Outdated
Comment thread react-compat.d.ts Outdated
Comment thread tsconfig.json Outdated
@socket-security

socket-security Bot commented Jun 29, 2026

Copy link
Copy Markdown

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.

View full report

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

✅ Preview is ready!

PR preview ✅ Ready ✅ Ready
🔗 Preview https://react-component-select-preview-pr-1235.surge.sh
📝 Commit48b5e30
⏱️ Build time24.706s
📦 Size2.2 MB (-33 B ⬇️) · 151 files
🪵 LogsView logs
📱 MobileScan to open preview on mobile

↩️ Previous: ⚡️ 48b5e30 · react-component-select-preview-pr-1235.surge.sh (open ↗) · 2026-07-02 04:03:35 UTC

🤖 Powered by surge-preview

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
select Ready Ready Preview, Comment Jul 2, 2026 4:04am

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 48b5e30.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/update-maintenance-deps

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.44%. Comparing base (eb9be1a) to head (48b5e30).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…nance-deps

# Conflicts:
#	tests/__snapshots__/ssr.test.tsx.snap
@afc163

afc163 commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

Related to ant-design/ant-design#58514.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between eb9be1a and 43a1b5e.

⛔ Files ignored due to path filters (6)
  • tests/__snapshots__/Combobox.test.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/Multiple.test.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/OptionList.test.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/Select.test.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/Tags.test.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/ssr.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (12)
  • .github/dependabot.yml
  • README.md
  • README.zh-CN.md
  • eslint.config.mjs
  • global.d.ts
  • package.json
  • src/BaseSelect/index.tsx
  • src/Select.tsx
  • src/hooks/useRefFunc.ts
  • src/utils/legacyUtil.ts
  • src/utils/warningPropsUtil.ts
  • tsconfig.json

Comment thread tsconfig.json
Copilot AI review requested due to automatic review settings July 2, 2026 02:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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.mjs using FlatCompat to reuse the existing .eslintrc.js under 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between 43a1b5e and c9818b5.

📒 Files selected for processing (2)
  • eslint.config.mjs
  • src/SelectInput/Content/index.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
eslint.config.mjs (1)

34-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Manual react-hooks rule wiring skips the plugin's official recommended preset.

eslint-plugin-react-hooks@7.1.1 ships reactHooks.configs.flat.recommended (and recommended-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's extends entry 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

📥 Commits

Reviewing files that changed from the base of the PR and between 930593b and e244b02.

📒 Files selected for processing (3)
  • .eslintrc.js
  • eslint.config.mjs
  • package.json
💤 Files with no reviewable changes (1)
  • .eslintrc.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants