chore: update maintenance dependencies#1079
Conversation
|
Deployment failed with the following error: Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough将开发工具链升级至 React 19、TypeScript 6、ESLint 9 和 Changes工具链升级与类型声明
其他配置更新
估算代码审查工作量🎯 3 (Moderate) | ⏱️ ~25 minutes 建议的审阅者
Poem
🚥 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.config.mjsParsing error: Cannot find module '
Make sure that all the Babel plugins and presets you are using 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 upgrades the project to React 19 and TypeScript 6, updates various dependencies (including ESLint to v9), and introduces compatibility shims and global type definitions. Feedback on these changes highlights critical type-safety concerns: disabling strict type-checking options in tsconfig.json reduces safety during this major upgrade, declaring test globals as any in global.d.ts overrides Jest's strongly-typed definitions, and shimming the deprecated hydrate method in react-compat.d.ts is unsafe and could lead to runtime crashes.
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, strictNullChecks, noImplicitAny, etc.) significantly reduces type safety and can mask potential runtime errors, especially during a major upgrade to React 19 and TypeScript 6. It is highly recommended to keep strict mode enabled and address the type errors directly.
| 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; |
| declare module 'react-dom' { | ||
| function hydrate(element: React.ReactNode, container: Element | DocumentFragment): void; | ||
| } |
There was a problem hiding this comment.
Shimming hydrate in react-dom for React 19 is unsafe. React 19 has completely removed hydrate from react-dom (replaced by hydrateRoot in react-dom/client). Shimming the type will allow the code to compile but will result in runtime crashes if hydrate is called. It is recommended to migrate the usage to hydrateRoot instead.
|
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.
Actionable comments posted: 3
🧹 Nitpick comments (1)
react-compat.d.ts (1)
3-6: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift
useRef()的零参数重载建议只作为极短期过渡。React 19 类型层面要求
useRef显式传入初始值;这里全局补回零参数签名后,旧调用点都不会再被tsc报出来,等于绕过了这次升级最有价值的一条检查。更稳妥的是把调用点改成useRef(undefined)/useRef(null),然后删除这个 augmentation。🤖 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` around lines 3 - 6, The zero-argument useRef overload added in the react module augmentation is masking React 19 migration errors. Update the affected call sites to pass an explicit initial value such as useRef(undefined) or useRef(null), using the useRef signature in react-compat.d.ts as the locator, and then remove this temporary augmentation so tsc continues to flag any remaining legacy usages.
🤖 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 ambient react-dom hydrate declaration from
react-compat.d.ts so the typings stay aligned with React 19. This module
augmentation is reintroducing an API that no longer exists at runtime and can
hide migration issues; update any call sites to use hydrateRoot instead of
relying on hydrate being typed.
In `@tsconfig.json`:
- Around line 39-41: 主 tsconfig 的 include 现在把 global.d.ts 一起纳入了,导致
vi、describe、it、expect 等测试全局泄露到 src 和 docs/examples。请把这些测试类型从主配置中移出,放到专用的测试
tsconfig 中,或将它们的范围限制到 tests/**/*,并保留 react-compat.d.ts 等业务通用声明在主配置里。
- Around line 31-37: The root tsconfig has been loosened too much by disabling
strict mode and related checks, which hides real type regressions across src,
tests, and docs/examples. Keep the main configuration strict, then move
test-only globals from global.d.ts into a separate test-specific declaration or
tsconfig so they do not leak into production source. In tsconfig and the shared
type declarations, preserve the strict baseline and only relax individual flags
temporarily where a migration blocker is unavoidable.
---
Nitpick comments:
In `@react-compat.d.ts`:
- Around line 3-6: The zero-argument useRef overload added in the react module
augmentation is masking React 19 migration errors. Update the affected call
sites to pass an explicit initial value such as useRef(undefined) or
useRef(null), using the useRef signature in react-compat.d.ts as the locator,
and then remove this temporary augmentation so tsc continues to flag any
remaining legacy usages.
🪄 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: 8abaa679-2826-4c54-948e-ed468ed5d7cc
📒 Files selected for processing (8)
.github/dependabot.ymlREADME.mdREADME.zh-CN.mdeslint.config.mjsglobal.d.tspackage.jsonreact-compat.d.tstsconfig.json
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 18-19: The TypeScript recommended-rule allowlist in
eslint.config.mjs is dropping custom rules from the old .eslintrc.js setup, so
update the migration logic around recommendedTsRules to preserve user-defined TS
rules instead of filtering them out. Make sure
`@typescript-eslint/no-inferrable-types` is carried through, and add an explicit
mapping in the config migration for `@typescript-eslint/no-empty-interface` to its
modern equivalent `@typescript-eslint/no-empty-object-type` so the same constraint
stays enabled.
🪄 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: 2caff7b9-bee0-4312-bb82-68c9a10c4adb
📒 Files selected for processing (3)
eslint.config.mjsglobal.d.tstsconfig.json
💤 Files with no reviewable changes (1)
- global.d.ts
| const recommendedTsRules = new Set( | ||
| Object.keys(tsEslintPlugin.configs.recommended.rules || {}), |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '== .eslintrc.js ==\n'
nl -ba .eslintrc.js | sed -n '1,240p'
printf '\n== `@typescript-eslint` rules declared in .eslintrc.js ==\n'
rg -n "`@typescript-eslint/`" .eslintrc.js || trueRepository: react-component/slider
Length of output: 219
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '== eslint.config.mjs (relevant slice) ==\n'
sed -n '1,140p' eslint.config.mjs | cat -n
printf '\n== .eslintrc.js (full) ==\n'
sed -n '1,240p' .eslintrc.js | cat -n
printf '\n== `@typescript-eslint` rule keys in .eslintrc.js ==\n'
python3 - <<'PY'
import re, pathlib
text = pathlib.Path('.eslintrc.js').read_text()
rules = sorted(set(re.findall(r'["\'](`@typescript-eslint/`[^"\']+)["\']\s*:', text)))
for r in rules:
print(r)
print(f'\ncount={len(rules)}')
PYRepository: react-component/slider
Length of output: 3863
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '== package.json references ==\n'
rg -n '"`@typescript-eslint/eslint-plugin`"|typescript-eslint|eslint' package.json package-lock.json pnpm-lock.yaml yarn.lock 2>/dev/null || true
printf '\n== repo files mentioning no-empty-interface / no-explicit-any / no-inferrable-types ==\n'
rg -n "`@typescript-eslint/`(no-explicit-any|no-empty-interface|no-inferrable-types)" -S .Repository: react-component/slider
Length of output: 20999
🌐 Web query:
@typescript-eslint/eslint-plugin recommended rules no-explicit-any no-empty-interface no-inferrable-types
💡 Result:
In the @typescript-eslint/eslint-plugin, the inclusion of these rules in the recommended configuration is as follows: - @typescript-eslint/no-explicit-any: Included in the recommended configuration [1]. - @typescript-eslint/no-empty-interface: Historically included in the recommended configuration, but this rule is now deprecated in favor of @typescript-eslint/no-empty-object-type [2], which is included in the recommended configuration [1]. - @typescript-eslint/no-inferrable-types: This rule is not included in the recommended configuration [1][3]. It is part of the stylistic configuration [4]. Summary Table Rule | Recommended Config | Notes --- | --- | --- @typescript-eslint/no-explicit-any | Yes [1] | - @typescript-eslint/no-empty-interface | Deprecated [2] | Replaced by @typescript-eslint/no-empty-object-type (included) [1][2] @typescript-eslint/no-inferrable-types | No [1][3] | Included in stylistic config [4] As of June 2026, typescript-eslint recommends using shared configurations such as recommended, strict, or stylistic [5][6]. The recommended configuration focuses on rules for code correctness, while the stylistic configuration contains rules that enforce consistent coding patterns without necessarily catching bugs [5].
Citations:
- 1: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended.ts
- 2: https://typescript-eslint.io/rules/no-empty-interface/
- 3: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/all.ts
- 4: https://typescript-eslint.io/rules/no-inferrable-types
- 5: https://typescript-eslint.io/users/configs
- 6: https://github.com/typescript-eslint/typescript-eslint/blob/v8.58.1/docs/getting-started/Quickstart.mdx
别静默丢掉自定义 TS 规则 这里会把 .eslintrc.js 里的 @typescript-eslint/no-inferrable-types 过滤掉;@typescript-eslint/no-empty-interface 也需要单独迁移/映射到 @typescript-eslint/no-empty-object-type,否则不会自动保留等价约束。
🤖 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 18 - 19, The TypeScript recommended-rule
allowlist in eslint.config.mjs is dropping custom rules from the old
.eslintrc.js setup, so update the migration logic around recommendedTsRules to
preserve user-defined TS rules instead of filtering them out. Make sure
`@typescript-eslint/no-inferrable-types` is carried through, and add an explicit
mapping in the config migration for `@typescript-eslint/no-empty-interface` to its
modern equivalent `@typescript-eslint/no-empty-object-type` so the same constraint
stays enabled.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1079 +/- ##
=======================================
Coverage 98.67% 98.67%
=======================================
Files 15 15
Lines 752 752
Branches 234 234
=======================================
Hits 742 742
Misses 10 10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
❌ Deploy failed
📋 Build log (last lines)🤖 Powered by surge-preview |
|||||||||
|
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/afc163s-projects?upgradeToPro=build-rate-limit |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
eslint.config.mjs (1)
18-25: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win不要在迁移时静默丢掉旧配置里的 TS 规则约束。
这里按
configs.recommended过滤@typescript-eslint/*后,.eslintrc.js里显式开启的@typescript-eslint/no-empty-interface会被直接删掉;但当前迁移里又没有把它改写成 v8 对应的@typescript-eslint/no-empty-object-type,所以这条 lint 约束会在 Flat 配置下消失,npm run lint会比旧配置更宽松。💡 最小修复思路
+const remappedTsRules = { + '`@typescript-eslint/no-empty-interface`': '`@typescript-eslint/no-empty-object-type`', +}; function normalizeConfig(config) { const normalizedConfig = { ...config }; if (normalizedConfig.rules) { - normalizedConfig.rules = Object.fromEntries( - Object.entries(normalizedConfig.rules).filter(([ruleName]) => { - if (!ruleName.startsWith('`@typescript-eslint/`')) { - return true; - } - - return recommendedTsRules.has(ruleName); - }), - ); + normalizedConfig.rules = Object.fromEntries( + Object.entries(normalizedConfig.rules).flatMap(([ruleName, ruleValue]) => { + const mappedRuleName = remappedTsRules[ruleName] ?? ruleName; + + if (!mappedRuleName.startsWith('`@typescript-eslint/`')) { + return [[mappedRuleName, ruleValue]]; + } + + return recommendedTsRules.has(mappedRuleName) + ? [[mappedRuleName, ruleValue]] + : []; + }), + ); } }并同步删除后面仅用于关闭
@typescript-eslint/no-empty-interface的覆盖项,避免把已迁移的新规则再关掉。Also applies to: 41-41
🤖 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 18 - 25, 迁移 Flat 配置时不要静默丢掉旧的 TS 规则约束;当前在 eslint.config.mjs 里通过 recommendedTsRules 过滤 `@typescript-eslint/`* 会把 .eslintrc.js 显式开启的 `@typescript-eslint/no-empty-interface` 删除掉。请在生成规则集时把这条约束迁移为 v8 对应的 `@typescript-eslint/no-empty-object-type`,并同步检查 ESLint 覆盖配置,移除只为关闭 `@typescript-eslint/no-empty-interface` 而存在的后续覆盖项,避免把新规则也一起关掉。
🤖 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.
Duplicate comments:
In `@eslint.config.mjs`:
- Around line 18-25: 迁移 Flat 配置时不要静默丢掉旧的 TS 规则约束;当前在 eslint.config.mjs 里通过
recommendedTsRules 过滤 `@typescript-eslint/`* 会把 .eslintrc.js 显式开启的
`@typescript-eslint/no-empty-interface` 删除掉。请在生成规则集时把这条约束迁移为 v8 对应的
`@typescript-eslint/no-empty-object-type`,并同步检查 ESLint 覆盖配置,移除只为关闭
`@typescript-eslint/no-empty-interface` 而存在的后续覆盖项,避免把新规则也一起关掉。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cf51e9eb-3273-463b-88fd-cb0295f82a1c
📒 Files selected for processing (2)
eslint.config.mjsreact-compat.d.ts
💤 Files with no reviewable changes (1)
- react-compat.d.ts

Summary
Test Plan
Summary by CodeRabbit