@andrewbranch/ts5to6

中文文档
1.1.1发布于 2025/10/08MITTypeScriptES Module近 30 天下载 1.3万

CLI to migrate TypeScript config files to be compatible with TypeScript 6.0

原始使用文档

ts5to6

A command-line tool to migrate TypeScript configuration files to be compatible with TypeScript 6.0.

Overview

TypeScript 6.0 introduces several deprecations and breaking changes. This tool automatically migrates tsconfig.json files to account for two configuration breaking changes:

  • baseUrl deprecation: Before TypeScript 4.1, baseUrl was required in order to use paths. Many users only used it to enable paths, but never removed it after it became unnecessary. This tool can safely remove baseUrl and update paths mappings if necessary.
  • rootDir default value change: TypeScript 6.0 changed how rootDir is inferred when unspecified. This tool can set explicit rootDir values to maintain TypeScript 5.x behavior.

Usage

# Choose which fix you need, or run each in series:
npx @andrewbranch/ts5to6 --fixBaseUrl .
npx @andrewbranch/ts5to6 --fixRootDir .

# Or to start with a config not named 'tsconfig.json':
npx @andrewbranch/ts5to6 --fixBaseUrl ./tsconfig.app.json
npx @andrewbranch/ts5to6 --fixRootDir ./tsconfig.app.json

From the starting tsconfig.json file, the tool will recursively run on references, and also try to discover and update any related config files that will see a change through extends.

版本与发布记录

@andrewbranch/ts5to6 共发布 2 个版本,首次发布于 2025/10/08;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.1.1latest2025/10/081.1 年前
1.1.02025/10/081.1 年前

关于 @andrewbranch/ts5to6 的常见问题

@andrewbranch/ts5to6 是什么?

CLI to migrate TypeScript config files to be compatible with TypeScript 6.0

如何安装 @andrewbranch/ts5to6?

在项目目录运行 npm install @andrewbranch/ts5to6,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ts5to6,可以用 npx ts5to6 直接运行。

@andrewbranch/ts5to6 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@andrewbranch/ts5to6 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@andrewbranch/ts5to6 可以商用吗?

@andrewbranch/ts5to6 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@andrewbranch/ts5to6 的下载量有多少?

根据 npm 官方下载统计,@andrewbranch/ts5to6 在 2026/10/06 – 2026/11/04 这 30 天内被下载 12,985 次,日均约 433 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@andrewbranch/ts5to6 还在维护吗?

最新版本 1.1.1 发布于 2025/10/08(1.1 年前);至今共发布 2 个版本,其中过去 12 个月发布了 0 个;首次发布于 2025/10/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。