chore: upgrade to TypeScript 6 - #45
Draft
claude[bot] wants to merge 1 commit into
Draft
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Łukasz Komoszyński · Slack thread
Upgrades TypeScript 5.9.3 →
^6.0.3with a realtsconfigmigration, so the repo type-checks and builds cleanly under TS 6 withoutignoreDeprecations.Why TS 6 needs a migration
TypeScript 6 turns previously-deprecated
tsconfigoptions into hard build errors. On this repo, TS 6 failed with:TS5101—Option 'baseUrl' is deprecatedTS5107—Option 'moduleResolution=node10' is deprecatedRather than silence these with
ignoreDeprecations, this PR fixes them properly.tsconfig migration
tsconfig.base.jsonbaseUrl: "."(fixesTS5101). Path mappings no longer requirebaseUrl(TS ≥ 4.1). Thepathsvalues are made relative ("./packages/…") so they keep resolving to the same files (otherwiseTS5090— "non-relative paths are not allowed whenbaseUrlis not set").moduleResolution:"node"(node10, deprecated) →"bundler"(fixesTS5107). This is the org-preferred setting and matches leancodepl/js_corelibrary'stsconfig.base.json. The repo builds via webpack / swc /@nx/js:tsc;bundlerresolution works with the existing basemodule: esnextand the per-projectmodule: commonjsemit configs.packages/invoice-template/tsconfig.jsonallowSyntheticDefaultImports: false(deprecated in TS 6). WithesModuleInterop: truethe option is inferred totrue, which is strictly more permissive, so removing it introduces no new type errors.package.json/ lockfiletypescript5.9.3→^6.0.3;package-lock.jsonregenerated.Verification
Green on Node 24.18.x with CI's exact steps and no
ignoreDeprecations:npm ci→nx format:check→nx run-many --all --target=lint→build→test --ci(all 4 projects, 5 tests pass).Merge order — important
Merge #43 (the bump PR) to
mainFIRST. Once #43 lands, GitHub auto-retargets this PR tomainand it can then be merged separately. Do NOT merge this TS-6 PR while #43 is still open — its base ischore/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).