Skip to content

chore: upgrade TypeScript to 6.0.3#48

Merged
aojunhao123 merged 2 commits into
react-component:masterfrom
aojunhao123:chore/upgrade-typescript-6
Jun 27, 2026
Merged

chore: upgrade TypeScript to 6.0.3#48
aojunhao123 merged 2 commits into
react-component:masterfrom
aojunhao123:chore/upgrade-typescript-6

Conversation

@aojunhao123

@aojunhao123 aojunhao123 commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Bump typescript from ^5.9.3 to ^6.0.3 — the latest stable release, still the JS-based compiler and compatible with the existing toolchain.
  • Modernize tsconfig.json for 6.x deprecations (which become hard errors in 7.0), fixing them properly instead of suppressing with ignoreDeprecations:
    • moduleResolution: nodebundler
    • drop deprecated baseUrl
    • make paths mappings relative

Why not TypeScript 7?

TS 7 is the native (Go) compiler rewrite. Its npm package ships only the tsc binary plus an experimental typescript/unstable/* API — it does not expose require('typescript'), the JS compiler API that father (dts generation) and @typescript-eslint depend on. npm run compile fails on native TS7 (ERR_PACKAGE_PATH_NOT_EXPORTED). 6.0.3 is the newest usable TS today; this tsconfig is already 7.0-ready for when the ecosystem catches up.

Test plan

  • npm run compile — father bundless (es/lib) + declaration generation + eslint hook all pass
  • npm test — 28/28 pass
  • tsc --noEmit on src/ — no errors

Summary by CodeRabbit

  • Chores
    • 升级了 TypeScript 版本,并更新了编译配置以适配新的模块解析方式。
    • 路径映射写法已调整为更明确的相对路径格式,提升了配置一致性。

Bump typescript from ^5.9.3 to ^6.0.3 (latest stable; the JS-based
compiler, ecosystem-compatible). TS 7 is the native rewrite and does
not yet expose the JS compiler API that father/typescript-eslint need.

Modernize tsconfig for 6.x's deprecations (removed in 7.0):
- moduleResolution: node -> bundler
- drop deprecated baseUrl
- make path mappings relative

Verified: pnpm compile (dts + eslint hook), pnpm test (28/28), tsc --noEmit on src all pass.
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@aojunhao123, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 31 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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

🚦 How do rate 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 see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 14390c55-8e07-4c83-b600-a3df44d7095d

📥 Commits

Reviewing files that changed from the base of the PR and between 315d9b2 and 0f80f1b.

📒 Files selected for processing (2)
  • tests/listy.behavior.test.tsx
  • typings.d.ts

Walkthrough

devDependencies 中的 typescript^5.9.3 升级至 ^6.0.3,并更新 tsconfig.jsonmoduleResolution 切换为 bundler,移除 baseUrl,路径映射统一添加 ./ 前缀。

变更内容

TypeScript 6 升级与配置调整

Layer / File(s) Summary
TypeScript 版本升级与编译配置调整
package.json, tsconfig.json
typescript 升级至 ^6.0.3moduleResolutionnode 改为 bundler,删除 baseUrlpaths 中各映射值统一加 ./ 前缀(./src/*./.dumi/tmp/*./src/index.ts)。

预计代码审查工作量

🎯 1 (Trivial) | ⏱️ ~3 minutes

🐇 版本跳跃到六点零,
模块解析换新衣,
bundler 接替旧 node
路径加上 ./ 更整齐,
小兔欢快敲键盘,升级顺利无难题!🎉

🚥 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 标题准确概括了这次 PR 的主要变更:升级 TypeScript 到 6.0.3。
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 unit tests (beta)
  • Create PR with unit tests

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
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 TypeScript dependency to version 6.0.3 and refactors the TypeScript configuration in tsconfig.json by changing moduleResolution to 'bundler', removing baseUrl, and prefixing path mappings with './'. The feedback suggests explicitly defining the 'module' option to avoid potential configuration errors when using the bundler module resolution strategy.

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
"target": "esnext",
"moduleResolution": "node",
"baseUrl": "./",
"moduleResolution": "bundler",

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.

medium

When using "moduleResolution": "bundler", it is highly recommended to explicitly set the "module" option (e.g., to "esnext" or "preserve"). Relying on the implicit default of "module" based on "target" can lead to configuration errors (such as TS5095: Option 'moduleResolution' must be set to 'node' ...) in certain IDEs or tooling environments that default to CommonJS.

Suggested change
"moduleResolution": "bundler",
"module": "esnext",
"moduleResolution": "bundler",

@socket-security

socket-security Bot commented Jun 27, 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
Addednpm/​typescript@​6.0.3100100909690

View full report

@thinkasany

Copy link
Copy Markdown
image

TS 6 enables noImplicitAny by default, surfacing latent issues:
- add ambient declare module '*.less' for docs example imports
- annotate implicitly-any test params/vars in RawList tests

tsc --noEmit -p tsconfig.json now passes with zero errors.
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (350735d) to head (0f80f1b).

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #48   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          207       207           
  Branches        61        61           
=========================================
  Hits           207       207           

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

@aojunhao123
aojunhao123 merged commit 077d6d8 into react-component:master Jun 27, 2026
8 checks passed
@aojunhao123
aojunhao123 deleted the chore/upgrade-typescript-6 branch June 27, 2026 15:30
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