Skip to content

chore: update maintenance dependencies#647

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

chore: update maintenance dependencies#647
afc163 wants to merge 15 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

  • 新功能
    • 新增依赖更新分组规则,方便按 npm 与 GitHub Actions 分开查看。
  • 文档
    • 更新 README 顶部徽标为可点击链接,并调整中英文文档排版与表格。
  • Bug 修复
    • 优化示例与测试中的类型标注,减少类型推断/断言导致的问题。
  • 开发体验
    • 更新 TypeScript、ESLint 与相关工具链配置,并补充全局类型声明。

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cascader Ready Ready Preview, Comment Jul 1, 2026 11:12am

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@afc163, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a64e73f4-b5e3-4bc9-b575-a75b6f338999

📥 Commits

Reviewing files that changed from the base of the PR and between 633301e and d4e8441.

📒 Files selected for processing (1)
  • global.d.ts

Walkthrough

本次改动升级了开发依赖与 ESLint/TypeScript 配置,新增全局类型声明,调整示例与测试中的 Cascader 类型写法,并更新了 Dependabot 分组和 README 文档。

Changes

工具链、类型与文档

Layer / File(s) Summary
依赖与编译配置
package.json, tsconfig.json, eslint.config.mjs
升级 ESLint、TypeScript、React 及相关插件/测试依赖,切换模块解析与路径映射,并迁移到 flat config。
全局类型声明
global.d.ts
新增静态资源、JSX、jest、vi 与 locale 的全局类型声明。
示例与测试类型适配
examples/multiple.tsx, tests/index.spec.tsx
为 Cascader 补充显式泛型与类型断言,并调整部分断言书写格式。
Dependabot 与 README
.github/dependabot.yml, README.md, README.zh-CN.md
为 npm 和 github-actions 增加更新分组,并调整中英文 README 的徽标链接与表格排版。

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

Possibly related PRs

Suggested reviewers: zombieJ

Poem

小兔蹦进工具链,
flat config 亮晶晶,
类型声明铺好路,
Cascader 跑得更安宁,
README 一闪,徽标也能跳门庭。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit d4e8441.

@socket-security

socket-security Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​types/​jest@​29.5.14 ⏵ 30.0.01001007780100
Addednpm/​@​types/​react@​19.2.171001007995100
Addednpm/​@​eslint/​eslintrc@​3.3.59910010084100
Addednpm/​@​eslint/​js@​9.39.410010010088100
Addednpm/​typescript@​6.0.3100100909690
Addednpm/​eslint@​9.39.49710010096100

View full report

@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

@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 project dependencies to React 19, TypeScript 6, and ESLint 9, introduces a flat ESLint configuration, and adds global type definitions. However, several changes reduce type safety, such as disabling strict mode in tsconfig.json, casting component props to any in examples and tests, and declaring Jest globals as any in global.d.ts. Feedback recommends keeping strict type-checking enabled, typing the state properly in examples to avoid any casts, and removing redundant global declarations that shadow existing typed definitions.

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 tsconfig.json Outdated
Comment thread tsconfig.json Outdated
Comment thread examples/multiple.tsx Outdated
Comment thread global.d.ts Outdated
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

✅ Preview is ready!

PR preview ✅ Ready ✅ Ready
🔗 Preview https://react-component-cascader-preview-pr-647.surge.sh
📝 Commitd4e8441
⏱️ Build time21.376s
📦 Size2.3 MB (no change) · 113 files
🪵 LogsView logs
📱 MobileScan to open preview on mobile

↩️ Previous: ⚡️ d4e8441 · react-component-cascader-preview-pr-647.surge.sh (open ↗) · 2026-07-01 11:13:46 UTC

🤖 Powered by surge-preview

@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.39%. Comparing base (b7492d2) to head (d4e8441).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #647   +/-   ##
=======================================
  Coverage   99.39%   99.39%           
=======================================
  Files          22       22           
  Lines         661      661           
  Branches      193      203   +10     
=======================================
  Hits          657      657           
  Misses          4        4           

☔ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (3)
react-compat.d.ts (1)

6-6: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

isValidElement 参数类型应使用 unknown 而非 {}

{} 在 TypeScript 中表示"任意非 nullish 值",语义不清晰且触发 @typescript-eslint/no-empty-object-type 规则。建议将参数类型改为 unknown

-  function isValidElement<P = any>(object: {} | null | undefined): object is React.ReactElement<P>;
+  function isValidElement<P = any>(object: unknown): object is React.ReactElement<P>;
🤖 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 `@react-compat.d.ts` at line 6, The `isValidElement` declaration is using `{}`
for its parameter type, which is too broad and triggers the empty-object-type
lint rule. Update the `isValidElement` signature in `react-compat.d.ts` to
accept `unknown` instead, while keeping the return type predicate as `object is
React.ReactElement<P>` so the narrowing behavior remains the same.
global.d.ts (1)

22-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

将 jest.Matchers 方法签名转换为函数属性签名以符合 ESLint 规则

当前使用的方法简写签名(如 lastCalledWith(...expected: unknown[]): R)会触发 @typescript-eslint/method-signature-style 规则错误。应改为函数属性形式:

 declare namespace jest {
   interface Matchers<R> {
-    lastCalledWith(...expected: unknown[]): R;
-    nthCalledWith(nthCall: number, ...expected: unknown[]): R;
-    toBeCalled(): R;
-    toBeCalledTimes(expected: number): R;
-    toBeCalledWith(...expected: unknown[]): R;
+    lastCalledWith: (...expected: unknown[]) => R;
+    nthCalledWith: (nthCall: number, ...expected: unknown[]) => R;
+    toBeCalled: () => R;
+    toBeCalledTimes: (expected: number) => R;
+    toBeCalledWith: (...expected: unknown[]) => R;
   }
 }
🤖 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 `@global.d.ts` around lines 22 - 30, The Jest matcher declarations in Matchers
should use function property syntax instead of method shorthand to satisfy
`@typescript-eslint/method-signature-style`. Update the signatures for
lastCalledWith, nthCalledWith, toBeCalled, toBeCalledTimes, and toBeCalledWith
in the jest namespace so they are declared as properties with function types,
keeping the same parameter and return types.
tsconfig.json (1)

8-8: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

关闭 strict 及全部严格子选项会显著削弱类型安全保障。

stricttrue 改为 false,并显式关闭 noImplicitAnystrictNullChecksstrictFunctionTypes 等子选项后,tsc -p tsconfig.json --noEmitlint:tsc)将不再捕获空指针、隐式 any、不安全函数赋值等一大类缺陷,等于以丢失类型检查能力来换取升级后的编译通过。

建议把放宽范围收敛到最小:仅针对升级后报错的具体文件/规则做局部豁免(例如目录级 override 或行内 // @ts-expect-error``),而非全局关闭严格模式。是否需要我帮忙梳理一份保留 strict: true 并按文件局部豁免的方案?

Also applies to: 21-26

🤖 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 `@tsconfig.json` at line 8, The tsconfig change globally disables strict type
safety, so revert the broad `strict`/sub-option relaxation in `tsconfig.json`
and keep `strict: true` with the existing `noImplicitAny`, `strictNullChecks`,
and `strictFunctionTypes` behavior intact. Instead, locate the specific
upgrade-related failures that led to this change and address them with narrow
fixes in the affected files or targeted overrides, using local suppressions such
as `@ts-expect-error` only where unavoidable. Focus on the `tsconfig.json`
strictness settings and preserve full project-wide type checking.
🤖 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 `@examples/multiple.tsx`:
- Around line 61-65: Replace the broad as any casts in the Cascader usage with
explicit generic typing on the Cascader component so the existing Option2-based
types flow through options, loadData, value, and onChange without suppressing
type checking. Use the component’s generic parameters on Cascader to match the
inferred CascaderProps<Option2, 'value', true> shape, and then remove the as any
assertions from the related props so the compiler can catch mismatches directly.

In `@tests/index.spec.tsx`:
- Around line 867-870: The multi-select Cascader test is hiding type errors by
casting both value and onChange to any, so update the test to use the
component’s generic parameters instead. Locate the Cascader usage in the
multi-select case and explicitly specify the proper option/value/checkable
generics on Cascader so that value and onChange are inferred correctly without
any casts, preserving API-sensitive type coverage.
- Around line 103-104: Replace the `as any` casts in the `Cascader` test usage
by explicitly providing the correct generic parameters on the `Cascader`
component, matching the pattern used in `examples/multiple.tsx`. Update the
relevant test cases that pass `options` and `onChange` so they use the
component’s public type contract directly, and keep the identifiers `Cascader`,
`addressOptions`, and `onMultipleChange` aligned with the inferred
multiple-selection types instead of weakening them through `any`.

---

Nitpick comments:
In `@global.d.ts`:
- Around line 22-30: The Jest matcher declarations in Matchers should use
function property syntax instead of method shorthand to satisfy
`@typescript-eslint/method-signature-style`. Update the signatures for
lastCalledWith, nthCalledWith, toBeCalled, toBeCalledTimes, and toBeCalledWith
in the jest namespace so they are declared as properties with function types,
keeping the same parameter and return types.

In `@react-compat.d.ts`:
- Line 6: The `isValidElement` declaration is using `{}` for its parameter type,
which is too broad and triggers the empty-object-type lint rule. Update the
`isValidElement` signature in `react-compat.d.ts` to accept `unknown` instead,
while keeping the return type predicate as `object is React.ReactElement<P>` so
the narrowing behavior remains the same.

In `@tsconfig.json`:
- Line 8: The tsconfig change globally disables strict type safety, so revert
the broad `strict`/sub-option relaxation in `tsconfig.json` and keep `strict:
true` with the existing `noImplicitAny`, `strictNullChecks`, and
`strictFunctionTypes` behavior intact. Instead, locate the specific
upgrade-related failures that led to this change and address them with narrow
fixes in the affected files or targeted overrides, using local suppressions such
as `@ts-expect-error` only where unavoidable. Focus on the `tsconfig.json`
strictness settings and preserve full project-wide type checking.
🪄 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: 7f970074-27ac-40df-9065-f8da0f636e04

📥 Commits

Reviewing files that changed from the base of the PR and between b7492d2 and dce8a81.

📒 Files selected for processing (10)
  • .github/dependabot.yml
  • README.md
  • README.zh-CN.md
  • eslint.config.mjs
  • examples/multiple.tsx
  • global.d.ts
  • package.json
  • react-compat.d.ts
  • tests/index.spec.tsx
  • tsconfig.json

Comment thread examples/multiple.tsx Outdated
Comment thread tests/index.spec.tsx Outdated
Comment thread tests/index.spec.tsx Outdated
@vercel

vercel Bot commented Jun 30, 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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
tests/index.spec.tsx (1)

128-129: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

该处又引入了 as any,与文件其余部分的显式泛型模式不一致

根据变更详情,"should support showCheckedStrategy child" 用例中 CascaderoptionsonChange 被改为通过 as any 传入,而本文件其他所有 Cascader 用例(如 Line 102-106、878-882)均已改为显式泛型参数 Cascader<BaseOptionType, 'value', true> 以消除 as any,且此前的评审意见也明确要求避免在测试中使用 as any 绕过类型检查。此处的写法与已确认修复的模式相悖,建议同样改用显式泛型参数。

请确认此处代码的实际内容,并考虑与其余用例保持一致。

#!/bin/bash
# 检查 showCheckedStrategy child 用例中 Cascader 的类型标注方式
rg -n -B5 -A15 "showCheckedStrategy child" tests/index.spec.tsx
🤖 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 `@tests/index.spec.tsx` around lines 128 - 129, The “should support
showCheckedStrategy child” Cascader usage has regressed to using as any for
options and onChange, which is inconsistent with the rest of
tests/index.spec.tsx. Update this test to match the existing explicit generic
pattern on Cascader<BaseOptionType, 'value', true> so the relevant symbols
Cascader, addressOptions, and onMultipleChange are typed without any casts.
🤖 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 95-97: The peerDependencies range for react and react-dom is too
strict and blocks React 18 consumers; in package.json, update the peer
dependency range to keep supporting React 18 unless this release is
intentionally breaking. Use the existing peerDependencies block for
react/react-dom and adjust the version constraints back to a compatible range,
or if React 19-only is intended, make the breaking change explicit in the
release notes.

In `@README.md`:
- Line 70: The README install example uses an invalid “ut install” command,
which will fail because this repo expects npm; update the install instructions
in both README examples to use npm install consistently, and verify any related
setup text around the install command matches the repo’s actual tooling.

---

Duplicate comments:
In `@tests/index.spec.tsx`:
- Around line 128-129: The “should support showCheckedStrategy child” Cascader
usage has regressed to using as any for options and onChange, which is
inconsistent with the rest of tests/index.spec.tsx. Update this test to match
the existing explicit generic pattern on Cascader<BaseOptionType, 'value', true>
so the relevant symbols Cascader, addressOptions, and onMultipleChange are typed
without any casts.
🪄 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: ab407671-47e2-40a5-bda2-4c299b67de55

📥 Commits

Reviewing files that changed from the base of the PR and between dce8a81 and d7fd67b.

⛔ Files ignored due to path filters (2)
  • tests/__snapshots__/index.spec.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/search.spec.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (7)
  • README.md
  • README.zh-CN.md
  • eslint.config.mjs
  • examples/multiple.tsx
  • package.json
  • tests/index.spec.tsx
  • tsconfig.json
✅ Files skipped from review due to trivial changes (1)
  • README.zh-CN.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • eslint.config.mjs

Comment thread package.json Outdated
Comment thread README.md Outdated
@afc163

afc163 commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

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

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.

1 participant