Skip to content

chore: update maintenance dependencies#1003

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

chore: update maintenance dependencies#1003
afc163 wants to merge 16 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

  • 新功能

    • 更新了代码检查配置与依赖管理方式,支持更现代的开发工具链。
    • 新增对测试相关类型与资源引用的全局识别支持。
  • 文档

    • 优化了中英文 README 的顶部展示与表格排版,提升可读性。
  • 修复

    • 调整若干内部状态初始化方式,减少未定义值带来的类型问题。
  • Chores

    • 升级多项开发依赖与 TypeScript/React 生态版本。
    • 更新项目编译与依赖解析配置。

@vercel

vercel Bot commented Jun 29, 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

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

本次变更用 eslint.config.mjs(Flat Config)替换旧版 .eslintrc.js,升级 ESLint/TypeScript/React 及测试相关依赖版本,调整 tsconfig.json 编译选项与 global.d.ts 类型声明,修正部分 hooks 中 useRef 的类型以兼容 undefined,并更新 dependabot 分组配置与 README 徽标/表格格式。

Changes

ESLint/TypeScript 工具链迁移

Layer / File(s) Summary
Flat ESLint 配置新增
eslint.config.mjs
新增 Flat Config,注册插件、忽略路径、JS/TS/React 规则及测试文件规则覆盖,并对多项规则进行禁用/调整。
依赖版本升级
package.json
移除旧 .eslintrc.js,新增 @eslint/js,ESLint 升至 v9,@typescript-eslint 替换为 typescript-eslint@^8.62.1,升级测试库、React/ReactDOM 19、TypeScript 6.x 及构建工具。
TypeScript 配置与全局类型声明
tsconfig.json, global.d.ts
moduleResolution 改为 bundler,新增 strict:false 与 module:"ESNext",移除 baseUrl/ignoreDeprecations;include 新增 global.d.ts;global.d.ts 新增类型引用与资源模块声明。
Hooks useRef 类型兼容调整
src/hooks/useIndicator.ts, src/hooks/useTouchMove.ts, src/hooks/useUpdate.ts
将多个 useRef 泛型显式加入 | undefined 并以 undefined 初始化,以适配更严格的类型检查。

Estimated code review effort: 3 (Moderate) | ~25 minutes

CI 配置与文档调整

Layer / File(s) Summary
Dependabot 分组配置
.github/dependabot.yml
为 npm 和 github-actions 生态新增 groups 分组规则,匹配模式均为 '*'。
README 徽标链接与表格格式调整
README.md, README.zh-CN.md
顶部徽标改为链接包裹形式指向 ant.design,README.zh-CN.md 中 Tab 属性表格排版对齐格式调整。

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: zombieJ

Poem

兔子敲键盘,配置换新装 🐇
Flat ESLint 上线,规则更响亮
undefined 加身,类型更牢靠
依赖齐升级,蹦跶又欢畅
徽标链上路,指向那片方塘 🌸

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次以维护性依赖升级为主的变更,且与实际改动相关。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 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.

@socket-security

socket-security Bot commented Jun 29, 2026

Copy link
Copy Markdown

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.

View full report

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the project's dependencies to React 19, ESLint 9, and TypeScript 6, introducing a flat ESLint configuration and adding global type definitions. Feedback highlights several critical issues: disabling strict type-checking flags in tsconfig.json reduces type safety; accessing .rules directly on tsEslintPlugin.configs.recommended in eslint.config.mjs fails under v8 (where it is an array), silently disabling TypeScript rules; and declaring Jest globals as any in global.d.ts overrides the strong types provided by @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 thread eslint.config.mjs Outdated
Comment thread global.d.ts Outdated
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
tabs Ready Ready Preview, Comment Jul 3, 2026 3:16am

@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 98.98%. Comparing base (2a1774b) to head (3438517).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1003   +/-   ##
=======================================
  Coverage   98.98%   98.98%           
=======================================
  Files          18       18           
  Lines         788      788           
  Branches      228      232    +4     
=======================================
  Hits          780      780           
  Misses          8        8           

☔ 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

✅ Preview is ready!

PR preview ✅ Ready ✅ Ready
🔗 Preview https://react-component-tabs-preview-pr-1003.surge.sh
📝 Commit3438517
⏱️ Build time35.741s
📦 Size2.0 MB · 68 files
🪵 LogsView logs
📱 MobileScan to open preview on mobile

↩️ Previous: ⚡️ 3438517 · react-component-tabs-preview-pr-1003.surge.sh (open ↗) · 2026-07-03 03:06:37 UTC

🤖 Powered by surge-preview

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

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

Reviewed by React Doctor for commit 3438517.

@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/afc163s-projects?upgradeToPro=build-rate-limit

@afc163

afc163 commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

Related to ant-design/ant-design#58514.

Copilot AI review requested due to automatic review settings July 2, 2026 03:56

Copilot AI 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.

Pull request overview

This PR modernizes the repo’s maintenance/tooling setup by upgrading core frontend + lint/test dependencies, moving ESLint to flat config (ESLint 9 + typescript-eslint 8 compatibility), and aligning documentation and automation (README + Dependabot) with the updated ecosystem.

Changes:

  • Upgrade React/ReactDOM, TypeScript, ESLint, Testing Library, and related typings/lint dependencies.
  • Replace legacy .eslintrc.js with an ESLint 9 flat config (eslint.config.mjs) and add global.d.ts to centralize ambient typings/module declarations.
  • Minor README tweaks (Ant Design logo link) and Dependabot grouping updates.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsconfig.json Updates TS module/moduleResolution and path mappings; adds global.d.ts to compilation scope.
tests/snapshots/overflow.test.tsx.snap Snapshot header URL update.
tests/snapshots/index.test.tsx.snap Snapshot header URL update.
src/hooks/useUpdate.ts Adjusts useRef typing to align with newer React type definitions.
src/hooks/useTouchMove.ts Adjusts useRef typing to align with newer React type definitions.
src/hooks/useIndicator.ts Adjusts useRef typing to align with newer React type definitions.
README.zh-CN.md Links Ant Design logo to https://ant.design and minor formatting cleanup.
README.md Links Ant Design logo to https://ant.design and minor formatting cleanup.
package.json Dependency/tooling upgrades (React 19, TS 6, ESLint 9, testing/lint ecosystem).
global.d.ts Adds global type references and ambient module declarations for build/test typing.
eslint.config.mjs Introduces ESLint flat config with React, Jest, and TypeScript integration.
.github/dependabot.yml Adds grouped Dependabot updates for npm + GitHub Actions.
.eslintrc.js Removes legacy ESLint config file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread eslint.config.mjs
Comment thread package.json

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (3)
eslint.config.mjs (3)

47-49: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

建议改用 eslint-plugin-react-hooks v7 的官方 flat 预设

当前手动只开启了 rules-of-hooksexhaustive-deps 两条规则,但 eslint-plugin-react-hooks@7.1.1(见 package.json)官方 flat 预设 reactHooks.configs.flat.recommended 新增了多条 React Compiler 相关规则(如 set-state-in-effectpurityrefsstatic-components 等)。手动列举规则会导致后续新增的推荐规则无法自动生效。

♻️ 建议改用官方预设
   {
     files: ['**/*.{js,jsx,ts,tsx}'],
     extends: [
       js.configs.recommended,
       react.configs.flat.recommended,
       react.configs.flat['jsx-runtime'],
+      reactHooks.configs.flat.recommended,
       prettier,
     ],
-    plugins: {
-      'react-hooks': reactHooks,
-    },
     languageOptions: {
       globals: {
         ...globals.browser,
         ...globals.node,
       },
     },
     settings: {
       react: {
         version: 'detect',
       },
     },
     rules: {
       'no-async-promise-executor': 'off',
       'no-empty-pattern': 'off',
       'no-irregular-whitespace': 'off',
       'no-prototype-builtins': 'off',
       'no-useless-escape': 'off',
       'no-extra-boolean-cast': 'off',
       'no-undef': 'off',
       'no-unused-vars': 'off',
       'react/no-find-dom-node': 'off',
       'react/display-name': 'off',
       'react/no-unknown-property': 'off',
       'react/prop-types': 'off',
-      'react-hooks/exhaustive-deps': 'warn',
-      'react-hooks/rules-of-hooks': 'error',
     },
   },

采用官方预设后建议先跑一遍 npm run lint,确认新增规则(尤其是较新的 compiler 相关规则)不会引入大量新告警。

Also applies to: 74-75

🤖 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 47 - 49, The React Hooks ESLint setup is
manually enabling only a small subset of rules, so update the eslint config to
use reactHooks.configs.flat.recommended from eslint-plugin-react-hooks instead
of listing rules individually. Adjust the reactHooks plugin configuration in
eslint.config.mjs so the official flat preset drives the rules, and keep the
existing plugin wiring compatible with the flat config structure. After the
change, run lint via the main config entry to verify the newer compiler-related
rules from react-hooks are applied without introducing unexpected failures.

69-69: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

全局关闭了未使用变量检测

no-unused-vars(第69行)与 @typescript-eslint/no-unused-vars(第87行)均被设为 'off',意味着整个代码库都不会检测未使用的变量/导入,可能导致死代码逐渐堆积。若这是为了避免迁移初期产生大量告警的临时妥协,建议后续逐步开启(例如配合 argsIgnorePattern: '^_' 等选项减少误报)。

Also applies to: 87-87

🤖 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` at line 69, The lint config is globally disabling
unused-variable checks by turning off both no-unused-vars and
`@typescript-eslint/no-unused-vars`, which allows dead code and unused imports to
slip through. Update the ESLint config to re-enable these rules in a controlled
way, using options like argsIgnorePattern: '^_' or similar suppression patterns
to reduce false positives. Make the change in the main lint configuration
entries for no-unused-vars and `@typescript-eslint/no-unused-vars` so the codebase
regains unused-variable detection without breaking intended underscore-prefixed
parameters.

40-46: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

统一 JSX 运行时配置

eslint.config.mjs 启用了 react.configs.flat['jsx-runtime'],但 tsconfig.json 仍是 "jsx": "react"。当前 .tsx 文件基本都手动导入了 React,暂时没暴露问题,但后续新增 JSX 文件若漏掉 import React,ESLint 就不会提示。建议二选一:改成 "react-jsx",或移除 jsx-runtime 预设。

🤖 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 - 46, The JSX runtime settings are
inconsistent between eslint.config.mjs and tsconfig.json: the ESLint flat config
enables react.configs.flat['jsx-runtime'], while TypeScript still uses the
classic React JSX transform. Update the setup in the relevant config symbols
(react.configs.flat['jsx-runtime'] in eslint.config.mjs and the jsx option in
tsconfig.json) so they agree, either by switching TypeScript to the automatic
runtime or by removing the jsx-runtime preset from ESLint.
🤖 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.

Nitpick comments:
In `@eslint.config.mjs`:
- Around line 47-49: The React Hooks ESLint setup is manually enabling only a
small subset of rules, so update the eslint config to use
reactHooks.configs.flat.recommended from eslint-plugin-react-hooks instead of
listing rules individually. Adjust the reactHooks plugin configuration in
eslint.config.mjs so the official flat preset drives the rules, and keep the
existing plugin wiring compatible with the flat config structure. After the
change, run lint via the main config entry to verify the newer compiler-related
rules from react-hooks are applied without introducing unexpected failures.
- Line 69: The lint config is globally disabling unused-variable checks by
turning off both no-unused-vars and `@typescript-eslint/no-unused-vars`, which
allows dead code and unused imports to slip through. Update the ESLint config to
re-enable these rules in a controlled way, using options like argsIgnorePattern:
'^_' or similar suppression patterns to reduce false positives. Make the change
in the main lint configuration entries for no-unused-vars and
`@typescript-eslint/no-unused-vars` so the codebase regains unused-variable
detection without breaking intended underscore-prefixed parameters.
- Around line 40-46: The JSX runtime settings are inconsistent between
eslint.config.mjs and tsconfig.json: the ESLint flat config enables
react.configs.flat['jsx-runtime'], while TypeScript still uses the classic React
JSX transform. Update the setup in the relevant config symbols
(react.configs.flat['jsx-runtime'] in eslint.config.mjs and the jsx option in
tsconfig.json) so they agree, either by switching TypeScript to the automatic
runtime or by removing the jsx-runtime preset from ESLint.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 39731f0a-0ab5-4cb3-b6a3-84b74e9a85d3

📥 Commits

Reviewing files that changed from the base of the PR and between 2a1774b and 3438517.

⛔ Files ignored due to path filters (2)
  • tests/__snapshots__/index.test.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/overflow.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (11)
  • .eslintrc.js
  • .github/dependabot.yml
  • README.md
  • README.zh-CN.md
  • eslint.config.mjs
  • global.d.ts
  • package.json
  • src/hooks/useIndicator.ts
  • src/hooks/useTouchMove.ts
  • src/hooks/useUpdate.ts
  • tsconfig.json
💤 Files with no reviewable changes (1)
  • .eslintrc.js

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.

2 participants