chore: update maintenance dependencies#317
Conversation
|
Deployment failed with the following error: Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit |
概要该 PR 将开发工具链升级至新版本:升级 变更内容工具链现代化
估算的代码审查工作量🎯 3 (Moderate) | ⏱️ ~25 minutes 可能相关的 PR
小诗
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: dependency version conflict. Check your lock file or package.json. 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's dependencies to React 19, ESLint 9, and TypeScript 6, introduces an ESLint flat configuration, and adds type declaration files for compatibility. Feedback on these changes emphasizes maintaining type safety: you should avoid disabling strict type-checking in tsconfig.json, refrain from globally overriding core React types in react-compat.d.ts to prevent consumer type conflicts, and remove redundant any declarations for testing globals in global.d.ts since Jest types are already referenced.
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 (strict: false, strictNullChecks: false, noImplicitAny: false, etc.) significantly reduces type safety and code quality. It can easily introduce runtime errors (such as TypeError: Cannot read properties of undefined) that TypeScript is designed to prevent. Instead of disabling these checks to accommodate React 19 or TypeScript upgrades, it is highly recommended to keep them enabled and resolve the underlying type errors in the codebase.
"strict": true| 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.
Globally overriding and augmenting core React types (like useRef, isValidElement, cloneElement, and hydrate) is highly discouraged. This can cause severe type conflicts and unexpected behavior for consumers of this library, as these global overrides will affect their own compilation environments if the declaration files are exported. Instead of globally overriding these types to bypass React 19 breaking changes, you should update the component implementations to use React 19-compatible patterns, or use local type assertions/helper functions 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 testing globals like describe, it, test, and expect as any overrides the strongly-typed definitions provided by @types/jest (which is referenced on line 1). This disables type safety in your test files. Since Jest types are already referenced, these declarations are redundant and reduce type safety.
|
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.
|
✅ Preview is ready!
↩️ Previous: ⚡️ 🤖 Powered by surge-preview |
|||||||||||||||
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
package.json (1)
49-80: 🩺 Stability & Availability | 🔵 Trivial补一条打包/文档冒烟检查。 这次同时升级了
father和dumi,而npm run lint/npm run tsc覆盖不到npm run build、npm run docs:build、npm run compile这条链路;合并前至少再补一条库构建和文档站点构建检查。🤖 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 `@package.json` around lines 49 - 80, The dependency upgrades in package.json affect the build and docs toolchain, but the current validation only covers linting and type checking. Add a smoke-check for the build path by running and/or documenting verification for the library build and docs site build, using the existing scripts such as build, docs:build, and compile, so the father and dumi upgrade is covered before merge.
🤖 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 `@eslint.config.mjs`:
- Around line 40-48: `next.rules` 的过滤逻辑把迁移中需要保留的
`@typescript-eslint/no-explicit-any` 丢掉了,导致原来在 `.eslintrc.js` 里显式关闭的规则在 flat
config 中失效。请在 `eslint.config.mjs` 的这段 allowlist 过滤中把
`@typescript-eslint/no-explicit-any` 加回去,或者在最终的 flat config `rules`
合并结果里再次显式关闭它,确保迁移后的行为与现有配置一致。
---
Nitpick comments:
In `@package.json`:
- Around line 49-80: The dependency upgrades in package.json affect the build
and docs toolchain, but the current validation only covers linting and type
checking. Add a smoke-check for the build path by running and/or documenting
verification for the library build and docs site build, using the existing
scripts such as build, docs:build, and compile, so the father and dumi upgrade
is covered before merge.
🪄 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: a88ad097-d820-49f0-a48f-5c1622bf7c23
📒 Files selected for processing (8)
.github/dependabot.ymlREADME.mdREADME.zh-CN.mdeslint.config.mjsglobal.d.tspackage.jsonreact-compat.d.tstsconfig.json
| 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'; | ||
| }), | ||
| ); |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '## file list\n'
git ls-files | rg '^(eslint\.config\.mjs|\.eslintrc\.js)$|typescript-eslint|eslint'
printf '\n## locate no-explicit-any and related ts rule filtering\n'
rg -n "`@typescript-eslint/no-explicit-any`|recommendedTsRules|ban-types|normalizeConfig|FlatCompat" eslint.config.mjs .eslintrc.jsRepository: react-component/progress
Length of output: 944
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '## eslint.config.mjs lines\n'
cat -n eslint.config.mjs | sed -n '1,140p'
printf '\n## .eslintrc.js lines\n'
cat -n .eslintrc.js | sed -n '1,120p'Repository: react-component/progress
Length of output: 3317
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re, json
cfg = Path('eslint.config.mjs').read_text()
legacy = Path('.eslintrc.js').read_text()
for name, text in [('eslint.config.mjs', cfg), ('.eslintrc.js', legacy)]:
print(f'## {name}')
for pat in ['no-explicit-any', 'recommendedTsRules', 'ban-types', 'normalizeConfig', 'FlatCompat']:
if pat in text:
print(f'contains {pat}')
print()
# simple extraction of the filter block if present
m = re.search(r'if \(next\.rules\) \{.*?Object\.fromEntries\(\s*Object\.entries\(next\.rules\)\.filter\(\(\[ruleName\]\) => \{(.*?)\}\),\s*\);\n', cfg, re.S)
print('filter_block_found=', bool(m))
if m:
print(m.group(1))
PYRepository: react-component/progress
Length of output: 539
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re
cfg = Path('eslint.config.mjs').read_text()
legacy = Path('.eslintrc.js').read_text()
for name, text in [('eslint.config.mjs', cfg), ('.eslintrc.js', legacy)]:
print(f'## {name}')
for pat in ['no-explicit-any', 'recommendedTsRules', 'ban-types', 'normalizeConfig', 'FlatCompat']:
if pat in text:
print(f'contains {pat}')
print()
m = re.search(r'if \(next\.rules\) \{.*?Object\.fromEntries\(\s*Object\.entries\(next\.rules\)\.filter\(\(\[ruleName\]\) => \{(.*?)\}\),\s*\);\n', cfg, re.S)
print('filter_block_found=', bool(m))
if m:
print(m.group(1))
PYRepository: react-component/progress
Length of output: 539
保留 @typescript-eslint/no-explicit-any 的迁移规则
.eslintrc.js:11 里有显式关闭,但 eslint.config.mjs:42-46 只保留 recommended 里的 TS 规则和 @typescript-eslint/ban-types,这个 override 会在迁移时被丢掉;后面的全局 rules 里也没有再关回去。可把它补进 allowlist,或在 flat config 末尾显式关闭。
🤖 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 40 - 48, `next.rules` 的过滤逻辑把迁移中需要保留的
`@typescript-eslint/no-explicit-any` 丢掉了,导致原来在 `.eslintrc.js` 里显式关闭的规则在 flat
config 中失效。请在 `eslint.config.mjs` 的这段 allowlist 过滤中把
`@typescript-eslint/no-explicit-any` 加回去,或者在最终的 flat config `rules`
合并结果里再次显式关闭它,确保迁移后的行为与现有配置一致。

Summary
Test Plan
Summary by CodeRabbit