Skip to content

chore: upgrade TypeScript to 5.9 #155

Description

@luojiyin1987

背景

当前仓库:

"typescript": "^4.8.4"

稳定版 TypeScript 已是 6.0。TS 6 明确把 moduleResolution: node(node10)和 baseUrl 标记为 deprecated,这些兼容项准备在 TypeScript 7 中移除。

分阶段策略

不直接 4.8 → 6.0。拆成三个 PR,每个 PR 的问题边界清楚:

  • PR A:chore: upgrade TypeScript to 5.9(本 issue)— 纯粹确认现有代码、Jest、build、package smoke 在现代 TS 5.x 下全部正常
  • PR B:chore(tsconfig): remove deprecated compiler options — 单独研究 moduleResolution: "Node" 现代化、baseUrl: "./" 是否可删
  • PR C:chore: upgrade TypeScript to 6.0 — 等 tsconfig 没有 deprecated option 后再动

避免一个 PR 混入依赖升级 + config 改动 + 类型错误修复 + 测试变化,导致 review 无法区分必要迁移和顺手重构。

ts-jest 不是阻碍:#154 已把 floor 提到 29.4.0,支持 TypeScript <7。

PR A 验证项

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

目标:一行依赖升级、零源码修改、全绿。

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