Skip to content

fix(templates): drop removed baseUrl option from TS tsconfigs#115

Merged
dawsontoth merged 1 commit into
mainfrom
fix/tsconfig-remove-baseurl
Jul 13, 2026
Merged

fix(templates): drop removed baseUrl option from TS tsconfigs#115
dawsontoth merged 1 commit into
mainfrom
fix/tsconfig-remove-baseurl

Conversation

@dawsontoth

Copy link
Copy Markdown
Contributor

What

Removes the baseUrl compiler option from all four TypeScript template tsconfig.json files:

  • template-react-ts
  • template-react-ts-ssr
  • template-vue-ts
  • template-vue-ts-ssr

Why

baseUrl is deprecated in TypeScript 6 (emits TS5101, which fails tsc unless ignoreDeprecations is set) and removed in TypeScript 7 (TS5102: Option 'baseUrl' has been removed). As shipped, tsc --noEmit on a generated project already errors out today — it just isn't caught by CI because no template runs tsc/vue-tsc (build is vite build, tests use Node's native type-stripping, lint is non-type-aware @eslint/js).

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 (path.resolve(import.meta.dirname, './src')). So dropping baseUrl keeps @/ 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 on baseUrl), @/ imports resolve
  • vite build → succeeds
  • Repo suite: dprint check clean, all 213 unit tests pass

Relationship to #114

This is independent of the TypeScript 7 bump in #114 — it fixes an already-broken tsc experience on main regardless of TS version. #114 (TS7) is being held as draft because vue-tsc is not yet compatible with the native TS7 compiler; see the tracking notes on that PR.

🤖 Generated with Claude Code

@dawsontoth
dawsontoth requested a review from a team as a code owner July 13, 2026 16:32

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the "baseUrl": "." configuration from the tsconfig.json files across several templates, including React TS, React TS SSR, Vue TS, and Vue TS SSR. There are no review comments, and I have no feedback to provide.

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
dawsontoth force-pushed the fix/tsconfig-remove-baseurl branch from 6a1ed67 to 868821f Compare July 13, 2026 16:42
@dawsontoth
dawsontoth merged commit a600cb4 into main Jul 13, 2026
27 checks passed
@dawsontoth
dawsontoth deleted the fix/tsconfig-remove-baseurl branch July 13, 2026 17:10
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.10.8 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant