chore: update maintenance dependencies#647
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 22 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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. Walkthrough本次改动升级了开发依赖与 ESLint/TypeScript 配置,新增全局类型声明,调整示例与测试中的 Cascader 类型写法,并更新了 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 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.
✅ Preview is ready!
↩️ Previous: ⚡️ 🤖 Powered by surge-preview |
|||||||||||||||
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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及全部严格子选项会显著削弱类型安全保障。将
strict由true改为false,并显式关闭noImplicitAny、strictNullChecks、strictFunctionTypes等子选项后,tsc -p tsconfig.json --noEmit(lint: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
📒 Files selected for processing (10)
.github/dependabot.ymlREADME.mdREADME.zh-CN.mdeslint.config.mjsexamples/multiple.tsxglobal.d.tspackage.jsonreact-compat.d.tstests/index.spec.tsxtsconfig.json
|
Deployment failed with the following error: Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit |
There was a problem hiding this comment.
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" 用例中
Cascader的options与onChange被改为通过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
⛔ Files ignored due to path filters (2)
tests/__snapshots__/index.spec.tsx.snapis excluded by!**/*.snaptests/__snapshots__/search.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (7)
README.mdREADME.zh-CN.mdeslint.config.mjsexamples/multiple.tsxpackage.jsontests/index.spec.tsxtsconfig.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
|
Related to ant-design/ant-design#58514. |

Summary
Test Plan
Summary by CodeRabbit