Skip to content

chore: update maintenance dependencies#445

Open
afc163 wants to merge 6 commits into
masterfrom
codex/update-maintenance-deps
Open

chore: update maintenance dependencies#445
afc163 wants to merge 6 commits into
masterfrom
codex/update-maintenance-deps

Conversation

@afc163

@afc163 afc163 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Link the Ant Design ecosystem logo in README files to https://ant.design
  • Update React, React DOM, TypeScript, ESLint, Testing Library, @types/, @typescript-eslint/, lint-staged, and related lint dependencies
  • Add ESLint flat config compatibility for ESLint 9 and TypeScript ESLint 8
  • Use grouped Dependabot updates for npm and GitHub Actions

Test Plan

  • npm run lint
  • npm run tsc

Summary by CodeRabbit

  • Documentation
    • 优化 README 顶部生态徽标与说明展示:支持点击跳转到官方网站。
    • 更新中文版 README 徽标为可点击链接,提升可访问性与跳转体验。
  • Chores
    • 升级前端开发/测试/代码规范相关工具与依赖版本。
    • 引入更完善的类型声明与兼容声明,并调整 TypeScript/ESLint 配置以提升检查与一致性。

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
collapse Ready Ready Preview, Comment Jun 30, 2026 11:03am

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@afc163, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 00364195-79f4-4a87-96e7-224f86ec3d90

📥 Commits

Reviewing files that changed from the base of the PR and between 09c0345 and 4ade4e3.

📒 Files selected for processing (3)
  • eslint.config.mjs
  • package.json
  • react-compat.d.ts

Walkthrough

更新了开发工具链配置、类型兼容声明和 TypeScript 编译设置,并将 README 顶部徽标改为可跳转链接,同时为 Dependabot 更新项新增了分组规则。

Changes

工具链升级与类型兼容

Layer / File(s) Summary
依赖版本更新与 dependabot 分组
package.json, .github/dependabot.yml
更新开发依赖版本并补充 ESLint 生态包;为 npm 和 GitHub Actions 更新项新增分组配置。
ESLint Flat Config 迁移
eslint.config.mjs
引入 FlatCompat,转换现有 ESLint 配置,过滤并覆写部分 @typescript-eslint 规则,导出 Flat Config 数组。
类型兼容声明
react-compat.d.ts, global.d.ts
补充 React/ReactDOM 兼容声明,以及 JSX、jest、vi、资源模块和 locale 的全局类型声明。
TypeScript 配置调整
tsconfig.json
调整模块解析与路径映射,修改严格性选项,并将新声明文件纳入编译范围。
README 徽标链接更新
README.md, README.zh-CN.md
将顶部徽标与说明改为指向 https://ant.design 的链接。

Sequence Diagram(s)

预估代码审查工作量

🎯 3 (Moderate) | ⏱️ ~20 minutes

可能相关的 PR

🐇 扁平配置轻轻落,
类型声明悄悄多。
徽标一点能跳转,
小兔耳朵乐呵呵。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次以维护性依赖和工具链更新为主的变更。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/update-maintenance-deps

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tsconfig.json Outdated
Comment on lines +16 to +22
"noImplicitAny": false,
"strictNullChecks": false,
"strictPropertyInitialization": false,
"strictFunctionTypes": false,
"strict": false,
"noImplicitThis": false,
"strictBindCallApply": false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
"noImplicitAny": false,
"strictNullChecks": false,
"strictPropertyInitialization": false,
"strictFunctionTypes": false,
"strict": false,
"noImplicitThis": false,
"strictBindCallApply": false
\"strict\": true

Comment thread react-compat.d.ts Outdated
Comment on lines +1 to +16
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;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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).

Comment thread global.d.ts Outdated
Comment on lines +49 to +56
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

❌ Deploy failed

PR preview ❌ Failed ❌ Failed
🔗 Preview https://react-component-collapse-preview-pr-445.surge.sh (may be unavailable)
📝 Commit4ade4e3
🪵 LogsView logs
📋 Build log (last lines)
npm warn exec The following package was not found and will be installed: surge@0.27.4

   Running as afc163@gmail.com (Student)

        project: ./docs-dist
         domain: react-component-collapse-preview-pr-445.surge.sh
           size: 39 files, 1.7 MB

   Aborted - you do not have permission to publish to react-component-collapse-preview-pr-445.surge.sh

🤖 Powered by surge-preview

@socket-security

socket-security Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​types/​jest@​29.5.14 ⏵ 30.0.01001007780100
Addednpm/​@​types/​react@​19.2.171001007995100
Addednpm/​@​eslint/​eslintrc@​3.3.59910010084100
Addednpm/​@​eslint/​js@​9.39.410010010088100
Addednpm/​typescript@​6.0.3100100909690
Addednpm/​eslint@​9.39.49710010096100

View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a314f98 and d31d7df.

📒 Files selected for processing (8)
  • .github/dependabot.yml
  • README.md
  • README.zh-CN.md
  • eslint.config.mjs
  • global.d.ts
  • package.json
  • react-compat.d.ts
  • tsconfig.json

Comment thread react-compat.d.ts

declare module 'react' {
type ReactText = string | number;
function useRef<T = undefined>(): React.MutableRefObject<T | undefined>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Comment thread react-compat.d.ts Outdated
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.24%. Comparing base (a314f98) to head (4ade4e3).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

React Doctor skipped this pull request — it changed no React files.

Reviewed by React Doctor for commit 4ade4e3.

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant