fix(templates): drop removed baseUrl option from TS tsconfigs#115
Merged
Conversation
1 task
The `baseUrl` compiler option is deprecated in TypeScript 6 (TS5101) and removed in TypeScript 7 (TS5102), so `tsc --noEmit` currently fails on the react-ts, react-ts-ssr, vue-ts, and vue-ts-ssr templates as shipped. Since TS 5.0 the `paths` mapping (`@/*` -> `./src/*`) resolves relative to tsconfig.json without `baseUrl`, and the Vite `@` alias is defined independently in vite.config.ts, so dropping `baseUrl` keeps `@/` imports working in both the type checker and the bundler. Verified with `tsc --noEmit` and `vite build` on generated projects. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dawsontoth
force-pushed
the
fix/tsconfig-remove-baseurl
branch
from
July 13, 2026 16:42
6a1ed67 to
868821f
Compare
|
🎉 This PR is included in version 1.10.8 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
What
Removes the
baseUrlcompiler option from all four TypeScript templatetsconfig.jsonfiles:template-react-tstemplate-react-ts-ssrtemplate-vue-tstemplate-vue-ts-ssrWhy
baseUrlis deprecated in TypeScript 6 (emitsTS5101, which failstscunlessignoreDeprecationsis set) and removed in TypeScript 7 (TS5102: Option 'baseUrl' has been removed). As shipped,tsc --noEmiton a generated project already errors out today — it just isn't caught by CI because no template runstsc/vue-tsc(build isvite build, tests use Node's native type-stripping, lint is non-type-aware@eslint/js).Since TS 5.0, the
pathsmapping (@/*→./src/*) resolves relative totsconfig.jsonwithoutbaseUrl, and the Vite@alias is defined independently invite.config.ts(path.resolve(import.meta.dirname, './src')). So droppingbaseUrlkeeps@/imports resolving in both the type checker and the bundler.Verification
On generated react-ts and vue-ts projects:
tsc --noEmit→ exit 0 (previously errored onbaseUrl),@/imports resolvevite build→ succeedsdprint checkclean, all 213 unit tests passRelationship to #114
This is independent of the TypeScript 7 bump in #114 — it fixes an already-broken
tscexperience onmainregardless of TS version. #114 (TS7) is being held as draft becausevue-tscis not yet compatible with the native TS7 compiler; see the tracking notes on that PR.🤖 Generated with Claude Code