Repository navigation
chore(tsconfig): drop baseUrl so the configs survive TypeScript 7 - #1764
Merged
Merged
Conversation
TypeScript 6 reports it as an error:
Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0.
Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
The repo pins typescript 5.9.3, so the current typecheck is quiet, but an
editor running a newer TypeScript flags it, and it becomes a hard failure
whenever the pin moves to 7.
In both configs baseUrl only anchors `paths`, and `paths` has not needed
it since TypeScript 4.4 — entries resolve relative to the tsconfig that
declares them. Every path here is already written relatively
("./packages/…", "./src/*"), so removing the line is the whole change.
Chose this over `"ignoreDeprecations": "6.0"`: that key silences the
message for one major version and has to be revisited, while this makes
the configs correct.
Nothing relies on baseUrl for bare-specifier resolution — there are no
`from "packages/…"` or `from "src/…"` imports under packages/*/src or
tests/e2e.
Verified with the repo's own typescript:
tsconfig.json 0 errors before, 0 after (234 files import via
@ccr/* or @/*, so a broken alias could not be silent)
tsconfig.node.json 1 error before, 1 after, byte-identical output —
a pre-existing TS18003 (its include is
"build/**/*.mjs" and allowJs is off), untouched here.
Re-checked both under TypeScript 6.0.3: the deprecation is gone and no new
diagnostic replaces it.
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.
TypeScript 6 reports this as an error:
The repo pins
[email protected], so the current typecheck is quiet. An editor running a newer TypeScript flags it now, and it becomes a hard failure the moment the pin moves to 7.Why removing it rather than silencing it
In both configs
baseUrlonly anchorspaths, andpathshas not needed it since TypeScript 4.4 — entries resolve relative to the tsconfig that declares them. Every path here is already written relatively ("./packages/…","./src/*"), so deleting the line is the entire change: one line from each file, nothing else."ignoreDeprecations": "6.0"would also quiet it, but it buys one major version and has to be revisited. This makes the configs correct instead.Why it is safe
baseUrlhas a second effect — it lets bare specifiers resolve against the base directory — so removing it can break imports that quietly relied on that. Checked: there are nofrom "packages/…"orfrom "src/…"imports underpackages/*/srcortests/e2e.Verification
Run with the repo's own TypeScript:
tsconfig.jsontsconfig.node.json234 files import through
@ccr/*or@/*, so a broken alias could not have been silent — it would be hundreds ofCannot find moduleerrors.That one
tsconfig.node.jsonerror is pre-existing and untouched:build/*.mjsdoes exist; the files are not picked up becauseallowJsis off. That looked out of scope for a deprecation fix, so I left it alone — happy to send it separately if you want it.Re-checked both configs under TypeScript 6.0.3: the deprecation is gone, and no new diagnostic replaces it.