Skip to content

chore: upgrade to TypeScript 6 - #44

Merged
Komoszek merged 1 commit into
chore/npm-dependencies-bumpfrom
chore/typescript-6
Jul 14, 2026
Merged

chore: upgrade to TypeScript 6#44
Komoszek merged 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). The earlier TS 6 attempt on #43 leaned on Nx 23.1.0's ignoreDeprecations: "6.0" shim; that was reverted from #43 and is redone properly here. Review/merge #43 first — this PR's base is chore/npm-dependencies-bump, so its diff will reduce to just the TS 6 changes once #43 lands.

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"). No baseUrl-relative bare imports existed in the sources, so nothing else needed fixing.
  • 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 with 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 (the nested @nx/eslint copy of TS 6 dedupes against the root now).

Verification

Green on Node 24.18.x with CI's exact steps and no ignoreDeprecations:

  • npm ci — clean
  • nx format:check --all
  • nx run-many --all --target=lint — 4/4 projects pass
  • nx run-many --all --target=build — 4/4 projects
  • nx run-many --all --target=test --ci — 4/4 projects, all tests pass

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 ⏱️ +3s
2 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

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

@Komoszek
Komoszek marked this pull request as ready for review July 14, 2026 14:09
@Komoszek
Komoszek merged commit eab8258 into chore/npm-dependencies-bump Jul 14, 2026
2 checks passed
@claude claude Bot mentioned this pull request Jul 14, 2026
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