Skip to content

chore: upgrade to TypeScript 6 - #45

Draft
claude[bot] wants to merge 1 commit into
chore/npm-dependencies-bumpfrom
chore/typescript-6
Draft

chore: upgrade to TypeScript 6#45
claude[bot] wants to merge 1 commit into
chore/npm-dependencies-bumpfrom
chore/typescript-6

Conversation

@claude

@claude claude Bot commented Jul 14, 2026

Copy link
Copy Markdown

Requested by Łukasz Komoszyński · Slack thread

Upgrades TypeScript 5.9.3 → ^6.0.3 with a real tsconfig migration, so the repo type-checks and builds cleanly under TS 6 without ignoreDeprecations.

Stacked on #43 (chore/npm-dependencies-bump). This PR's base is chore/npm-dependencies-bump, so its diff reduces to just the TS 6 changes.

Why TS 6 needs a migration

TypeScript 6 turns previously-deprecated tsconfig options into hard build errors. On this repo, TS 6 failed with:

  • TS5101Option 'baseUrl' is deprecated
  • TS5107Option 'moduleResolution=node10' is deprecated

Rather than silence these with ignoreDeprecations, this PR fixes them properly.

tsconfig migration

tsconfig.base.json

  • Removed baseUrl: "." (fixes TS5101). Path mappings no longer require baseUrl (TS ≥ 4.1). The paths values are made relative ("./packages/…") so they keep resolving to the same files (otherwise TS5090 — "non-relative paths are not allowed when baseUrl is not set").
  • moduleResolution: "node" (node10, deprecated) → "bundler" (fixes TS5107). This is the org-preferred setting and matches leancodepl/js_corelibrary's tsconfig.base.json. The repo builds via webpack / swc / @nx/js:tsc; bundler resolution works with the existing base module: esnext and the per-project module: commonjs emit configs.

packages/invoice-template/tsconfig.json

  • Dropped allowSyntheticDefaultImports: false (deprecated in TS 6). With esModuleInterop: true the option is inferred to true, which is strictly more permissive, so removing it introduces no new type errors.

package.json / lockfile

  • typescript 5.9.3^6.0.3; package-lock.json regenerated.

Verification

Green on Node 24.18.x with CI's exact steps and no ignoreDeprecations: npm cinx format:checknx run-many --all --target=lintbuildtest --ci (all 4 projects, 5 tests pass).

Merge order — important

Merge #43 (the bump PR) to main FIRST. Once #43 lands, GitHub auto-retargets this PR to main and it can then be merged separately. Do NOT merge this TS-6 PR while #43 is still open — its base is chore/npm-dependencies-bump, so merging now would fold the TS-6 change back into #43's branch (which is exactly the state this PR was created to undo).

This PR replaces the previous #44 (which was closed).

Upgrades TypeScript 5.9.3 -> ^6.0.3 with a real tsconfig migration, so the
project type-checks and builds cleanly under TS 6 with NO `ignoreDeprecations`.
Stacked on chore/npm-dependencies-bump (PR #43).

TS 6 turns deprecated tsconfig options into hard errors (TS5101 / TS5107). The
migration addresses them properly instead of silencing them:

- tsconfig.base.json:
  - Remove `baseUrl` (TS5101). Path mappings resolve without baseUrl since TS
    4.1; the `paths` values are made relative (`./packages/...`) so they resolve
    correctly (TS5090). No baseUrl-relative bare imports existed in the sources.
  - `moduleResolution`: `node` (node10, deprecated → TS5107) -> `bundler`, the
    org-preferred setting (matches leancodepl/js_corelibrary). The repo builds
    via webpack/swc/tsc; bundler resolution works with the existing
    `module: esnext` base and the per-project `module: commonjs` emit configs.
- packages/invoice-template/tsconfig.json: drop `allowSyntheticDefaultImports:
  false` (deprecated in TS 6). With `esModuleInterop: true` the value is
  inferred to `true`, which is strictly more permissive, so no new type errors.
- package.json: typescript 5.9.3 -> ^6.0.3; package-lock.json regenerated.

Verified green on Node 24.18.x with CI's steps: npm ci, nx format:check, lint,
build, test (all 4 projects), with no `ignoreDeprecations`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ET2dL5CiUkuFR1ZGiUrUH
@github-actions

Copy link
Copy Markdown

Test Results

5 tests  ±0   5 ✅ ±0   5s ⏱️ +2s
2 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit c1a1ef6. ± Comparison against base commit 41d5034.

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.

1 participant