Skip to content

chore: upgrade TypeScript to 6.0 #159

Description

@luojiyin1987

背景

master 已包含 #158 的 NodeNext 现代化配置(baseUrl 已移除)。当前 typescript ^5.9.0。

截至现在 TypeScript 最新稳定版是 7.0.2,npm 上最新 6.x 是 6.0.3。有意停在 6.x:ts-jest 29.4.12 的正式 peer contract 仍是 >=4.3 <7,TS 7 不属于普通兼容路径(native compiler / 特殊兼容方案是独立课题)。

路线:#158 NodeNext 配置现代化 ✅ → TS 6.0.3 → 稳定一段 → 再研究 TS 7。

预期风险

TS 6 不是普通版本升级,它是通往 TS 7 的 transition release,改变了部分 compiler defaults:

  • rootDir 默认推断行为
  • types 默认值(本项目已显式配置 ["jest", "node"],不受影响)

验证项

  • npm run typecheck
  • npm run build
  • npm test -- --runInBand
  • npm run test:package

重点关注发布路径 lib/src/lint-md.js、lib/src/utils/lint-worker.js 保持不变、emit 仍为 CJS。test:package 会实际安装 CLI,是本次升级最关键的防线。

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions