chore: update maintenance dependencies#790
Conversation
|
Deployment failed with the following error: Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit |
|
Warning Review limit reached
Next review available in: 45 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将 React 升级至 19.x、TypeScript 升级至 6.x、ESLint 升级至 9.x,新增 Changes工具链升级与 React 19 兼容
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 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. |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request upgrades the project's development dependencies to support React 19 and TypeScript 6.0, introduces a flat ESLint configuration (eslint.config.mjs), adds global type declarations, and configures Dependabot grouping. Feedback on these changes focuses on maintaining type safety and configuration cleanliness: the reviewer advises against disabling strict type-checking flags in tsconfig.json, suggests avoiding declaring standard testing globals as any in global.d.ts to preserve proper Jest types, and recommends simplifying the ESLint configuration by removing obsolete workarounds for @typescript-eslint/ban-types.
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 type-checking options (such as strict, strictNullChecks, noImplicitAny, etc.) significantly reduces type safety and makes the codebase more prone to runtime errors (e.g., TypeError: Cannot read properties of undefined). For a widely used utility library like @rc-component/util, maintaining strict type safety is crucial. Please consider keeping these strict checks enabled and resolving any type errors introduced by the React 19 or TypeScript 6.0 upgrades instead of disabling them globally.
"strict": true| const noopRule = { | ||
| meta: { type: 'problem', docs: {}, schema: [] }, | ||
| create: () => ({}), | ||
| }; | ||
|
|
||
| function normalizeConfig(config) { | ||
| const next = { ...config }; | ||
|
|
||
| if (next.plugins?.['@typescript-eslint']) { | ||
| next.plugins = { | ||
| ...next.plugins, | ||
| '@typescript-eslint': { | ||
| ...next.plugins['@typescript-eslint'], | ||
| rules: { | ||
| ...next.plugins['@typescript-eslint'].rules, | ||
| 'ban-types': noopRule, | ||
| }, | ||
| }, | ||
| }; | ||
| } | ||
|
|
||
| if (next.rules) { | ||
| next.rules = Object.fromEntries( | ||
| Object.entries(next.rules).filter(([ruleName]) => { | ||
| if (!ruleName.startsWith('@typescript-eslint/')) { | ||
| return true; | ||
| } | ||
| return recommendedTsRules.has(ruleName) || ruleName === '@typescript-eslint/ban-types'; | ||
| }), | ||
| ); | ||
| } | ||
|
|
||
| return next; | ||
| } |
There was a problem hiding this comment.
Since @typescript-eslint/ban-types has been completely removed in @typescript-eslint v8, we can simplify this configuration. Instead of creating a dummy noopRule and mutating the plugin's rules, we can simply filter out @typescript-eslint/ban-types from the legacy rules in normalizeConfig and avoid referencing it in the flat config. This keeps the configuration clean and avoids hacky plugin mutations.
function normalizeConfig(config) {
const next = { ...config };
if (next.rules) {
next.rules = Object.fromEntries(
Object.entries(next.rules).filter(([ruleName]) => {
if (!ruleName.startsWith('@typescript-eslint/')) {
return true;
}
return recommendedTsRules.has(ruleName);
}),
);
}
return next;
}| { | ||
| rules: { | ||
| '@typescript-eslint/ban-types': 'off', | ||
| '@typescript-eslint/no-empty-object-type': 'off', | ||
| '@typescript-eslint/no-unsafe-function-type': 'off', | ||
| '@typescript-eslint/no-unused-vars': 'off', | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Since @typescript-eslint/ban-types is removed in v8 and filtered out in normalizeConfig, we do not need to configure it as 'off' here. Removing it simplifies the configuration.
{
rules: {
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},| 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 standard testing globals (describe, it, test, expect, etc.) as any overrides the proper types provided by @types/jest (referenced on line 1). This completely disables type safety and autocompletion in test files. If there are type conflicts, it is better to resolve them via tsconfig.json types configuration or by using explicit imports rather than casting these globals to any globally.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
❌ Deploy failed
📋 Build log (last lines)🤖 Powered by surge-preview |
|||||||||
|
React Doctor found 1 issue in 1 file · 1 error · score 40 / 100 (Critical) · vs Errors
Reviewed by React Doctor for commit |
|
Deployment failed with the following error: Learn More: https://vercel.com/afc163s-projects?upgradeToPro=build-rate-limit |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #790 +/- ##
=======================================
Coverage 86.42% 86.42%
=======================================
Files 39 39
Lines 1068 1068
Branches 373 388 +15
=======================================
Hits 923 923
Misses 143 143
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
global.d.ts (1)
11-20: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value尽量不要在这里继续声明全局
JSX命名空间。 仓库里已经没有其他JSX.*旧引用,兼容层可以收敛到React.JSX/declare module 'react'。🤖 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 11 - 20, Remove the remaining global JSX namespace declaration in the ambient typings and migrate this compatibility layer to React.JSX or a declare module 'react' augmentation instead. Update the JSX-related type aliases/interfaces currently defined in global.d.ts so they no longer reopen global JSX, and keep the existing React.JSX symbols as the source of truth for Element, IntrinsicElements, and related types.tests/ref.test.tsx (1)
14-14: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win把版本判断改成按 major version 解析。
React.version.startsWith('19')只覆盖 19.x,升级到 React 20 后这些断言会回落到旧分支;这里改成isReact19OrNewer,与src/ref.ts的ReactMajorVersion >= 19保持一致。🤖 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/ref.test.tsx` at line 14, The React version check in the test file is too narrow because React.version.startsWith('19') only matches 19.x, so update the test’s version gate to parse the major version and rename it to align with src/ref.ts’s ReactMajorVersion >= 19 logic. Locate the existing isReact19 constant in tests/ref.test.tsx and replace it with an isReact19OrNewer-style check based on the parsed major version so the assertions follow the same branch as the production code for React 20+.
🤖 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`:
- Around line 14-16: Remove the legacy react-dom hydrate compatibility
declaration from react-compat.d.ts so TypeScript no longer exposes an API that
is unavailable in React/ReactDOM 19. Update any callers that rely on this
declaration to use hydrateRoot from react-dom/client instead, and verify the
ReactDOM typings align with the new client-based hydration entry point.
---
Nitpick comments:
In `@global.d.ts`:
- Around line 11-20: Remove the remaining global JSX namespace declaration in
the ambient typings and migrate this compatibility layer to React.JSX or a
declare module 'react' augmentation instead. Update the JSX-related type
aliases/interfaces currently defined in global.d.ts so they no longer reopen
global JSX, and keep the existing React.JSX symbols as the source of truth for
Element, IntrinsicElements, and related types.
In `@tests/ref.test.tsx`:
- Line 14: The React version check in the test file is too narrow because
React.version.startsWith('19') only matches 19.x, so update the test’s version
gate to parse the major version and rename it to align with src/ref.ts’s
ReactMajorVersion >= 19 logic. Locate the existing isReact19 constant in
tests/ref.test.tsx and replace it with an isReact19OrNewer-style check based on
the parsed major version so the assertions follow the same branch as the
production code for React 20+.
🪄 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: 4031d7ea-5dae-4dee-b58e-e3cc0318287c
📒 Files selected for processing (10)
.github/dependabot.ymlREADME.mdREADME.zh-CN.mdeslint.config.mjsglobal.d.tspackage.jsonreact-compat.d.tstests/hooks-17.test.tsxtests/ref.test.tsxtsconfig.json

Summary
Test Plan
Summary by CodeRabbit
新功能
Bug 修复
文档