chore: update maintenance dependencies#445
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 47 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. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Walkthrough更新了开发工具链配置、类型兼容声明和 TypeScript 编译设置,并将 README 顶部徽标改为可跳转链接,同时为 Dependabot 更新项新增了分组规则。 Changes工具链升级与类型兼容
Sequence Diagram(s)预估代码审查工作量🎯 3 (Moderate) | ⏱️ ~20 minutes 可能相关的 PR
诗
🚥 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 |
There was a problem hiding this comment.
Code Review
This pull request updates the project dependencies to React 19, TypeScript 6, and ESLint 9, introduces a flat ESLint configuration, groups Dependabot updates, and adds type declarations for React 19 compatibility. Feedback on these changes highlights critical type-safety concerns: disabling strict TypeScript checks in tsconfig.json reduces type safety, ambient module augmentation of react and react-dom in react-compat.d.ts can cause global type conflicts for library consumers, and manually declaring Jest globals as any in global.d.ts overrides strongly-typed definitions from @types/jest.
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.
| "noImplicitAny": false, | ||
| "strictNullChecks": false, | ||
| "strictPropertyInitialization": false, | ||
| "strictFunctionTypes": false, | ||
| "strict": false, | ||
| "noImplicitThis": false, | ||
| "strictBindCallApply": false |
There was a problem hiding this comment.
Disabling strict TypeScript checks ("strict", "strictNullChecks", "noImplicitAny", etc.) significantly reduces type safety. As a library package, maintaining strict type checking is essential to prevent runtime bugs and ensure correct types for consumers. It is highly recommended to keep strict mode enabled and resolve any type errors directly in the code.
| "noImplicitAny": false, | |
| "strictNullChecks": false, | |
| "strictPropertyInitialization": false, | |
| "strictFunctionTypes": false, | |
| "strict": false, | |
| "noImplicitThis": false, | |
| "strictBindCallApply": false | |
| \"strict\": true |
| import * as React from 'react'; | ||
|
|
||
| declare module 'react' { | ||
| type ReactText = string | number; | ||
| function useRef<T = undefined>(): React.MutableRefObject<T | undefined>; | ||
| function isValidElement<P = any>(object: {} | null | undefined): object is React.ReactElement<P>; | ||
| function cloneElement<P = any>( | ||
| element: React.ReactElement<P>, | ||
| props?: (Partial<P> & React.Attributes) | null, | ||
| ...children: React.ReactNode[] | ||
| ): React.ReactElement<P>; | ||
| } | ||
|
|
||
| declare module 'react-dom' { | ||
| function hydrate(element: React.ReactNode, container: Element | DocumentFragment): void; | ||
| } |
There was a problem hiding this comment.
Ambient module augmentation of '"react"' and '"react-dom"' in a library package is highly discouraged. Because these declarations are global, they will merge with the React types in any consumer's project that installs this library. This can cause unexpected type conflicts, break their own React 19 typings, or mask type errors in their codebase. Instead of globally overriding React types, please handle React 19 compatibility locally within the codebase (e.g., by defining local helper types or using explicit type assertions where necessary).
| declare const describe: any; | ||
| declare const it: any; | ||
| declare const test: any; | ||
| declare const beforeEach: any; | ||
| declare const afterEach: any; | ||
| declare const beforeAll: any; | ||
| declare const afterAll: any; | ||
| declare const expect: any; |
There was a problem hiding this comment.
Declaring Jest globals ("describe", "it", "test", etc.) as "any" overrides the strongly-typed definitions provided by @types/jest (which is referenced on line 1). This disables type safety for your test files. Since @types/jest is already included, these manual declarations are redundant and degrade type safety.
❌ Deploy failed
📋 Build log (last lines)🤖 Powered by surge-preview |
|||||||||
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
global.d.ts (1)
49-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win不要把测试全局重新声明成
any。前面已经引入了 Jest 类型,这几行会把
describe/it/expect等全局的精确签名全部抹掉,测试侧类型检查基本失效。直接删掉这组声明更稳。建议修改
-declare const describe: any; -declare const it: any; -declare const test: any; -declare const beforeEach: any; -declare const afterEach: any; -declare const beforeAll: any; -declare const afterAll: any; -declare const expect: 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 `@global.d.ts` around lines 49 - 56, Remove the redundant test global declarations in global.d.ts that re-declare describe, it, test, beforeEach, afterEach, beforeAll, afterAll, and expect as any, since they override the Jest typings already in use. Delete this block entirely so the existing precise Jest signatures remain available to the test code and type checking stays intact.
🤖 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 `@react-compat.d.ts`:
- Line 5: Remove the React 19 compatibility backfills from react-compat.d.ts:
delete the extra useRef() no-arg overload and the react-dom/hydrate declaration
so the type system no longer reintroduces removed legacy APIs. Keep the
remaining compat declarations only if they are still needed, and let callers
migrate to the standard React 19 patterns such as useRef(null | undefined) and
hydrateRoot.
- Around line 14-15: The react-dom compatibility declaration is reintroducing
the removed hydrate API and should be deleted from react-compat.d.ts. Remove the
hydrate declaration from the declare module 'react-dom' block so outdated calls
stop type-checking, and leave the React 19-compatible path through hydrateRoot
as the supported entry point.
---
Nitpick comments:
In `@global.d.ts`:
- Around line 49-56: Remove the redundant test global declarations in
global.d.ts that re-declare describe, it, test, beforeEach, afterEach,
beforeAll, afterAll, and expect as any, since they override the Jest typings
already in use. Delete this block entirely so the existing precise Jest
signatures remain available to the test code and type checking stays intact.
🪄 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: 33bc2219-7cde-4920-8110-c879fdfe8e54
📒 Files selected for processing (8)
.github/dependabot.ymlREADME.mdREADME.zh-CN.mdeslint.config.mjsglobal.d.tspackage.jsonreact-compat.d.tstsconfig.json
|
|
||
| declare module 'react' { | ||
| type ReactText = string | number; | ||
| function useRef<T = undefined>(): React.MutableRefObject<T | undefined>; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Repo root: '; pwd
echo
git ls-files | rg 'react-compat\.d\.ts|react.*compat|hydrateRoot|hydrate\b|useRef\b'
echo
echo '--- react-compat.d.ts ---'
cat -n react-compat.d.ts
echo
echo '--- surrounding references to useRef/hydrate in repo ---'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' '\buseRef\b|\bhydrateRoot\b|\bhydrate\b' .Repository: react-component/collapse
Length of output: 1198
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- package.json ---'
cat -n package.json
echo
echo '--- tsconfig files ---'
git ls-files | rg 'tsconfig.*\.json$'
echo
for f in $(git ls-files | rg 'tsconfig.*\.json$'); do
echo "--- $f ---"
cat -n "$f"
echo
done
echo '--- react-related mentions ---'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' '"react"|react-dom|`@types/react`|`@types/react-dom`|React 19|hydrateRoot' package.json .github README* .Repository: react-component/collapse
Length of output: 5539
移除 react-compat.d.ts 里的 React 19 兼容回补。 react-compat.d.ts:5,15
当前依赖已经是 react@19 / @types/react@19,这里再声明 useRef() 无参重载和 react-dom/hydrate 会把旧 API 重新放回类型系统,掩盖需要迁移的调用点。建议删掉这两项,让代码统一走 useRef(null | undefined) 和 hydrateRoot。
🤖 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 5, Remove the React 19 compatibility backfills
from react-compat.d.ts: delete the extra useRef() no-arg overload and the
react-dom/hydrate declaration so the type system no longer reintroduces removed
legacy APIs. Keep the remaining compat declarations only if they are still
needed, and let callers migrate to the standard React 19 patterns such as
useRef(null | undefined) and hydrateRoot.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #445 +/- ##
=======================================
Coverage 99.24% 99.24%
=======================================
Files 5 5
Lines 132 132
Branches 46 47 +1
=======================================
Hits 131 131
Misses 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
React Doctor skipped this pull request — it changed no React files. Reviewed by React Doctor for commit |
|
Deployment failed with the following error: Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit |

Summary
Test Plan
Summary by CodeRabbit