Skip to content

chore(tsconfig): drop baseUrl so the config survives TypeScript 7 - #7193

Open
ntdatt812 wants to merge 1 commit into
farion1231:mainfrom
ntdatt812:chore/tsconfig-baseurl
Open

ntdatt812 wants to merge 1 commit into
farion1231:mainfrom
ntdatt812:chore/tsconfig-baseurl

Conversation

@ntdatt812

Copy link
Copy Markdown
Contributor

TypeScript 6 reports this 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 [email protected], so npm run typecheck is quiet today. 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

baseUrl here only anchors paths, and paths has not needed it since TypeScript 4.4 — entries resolve relative to the tsconfig that declares them. That makes "src/*" → "./src/*" the only other change.

"ignoreDeprecations": "6.0" would also make the message go away, but it buys one major version and has to be revisited. This makes the config correct instead.

Why it is safe

baseUrl has 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 no from "src/…"-style imports anywhere under src/, only relative ones and the @/ alias.

Build and tests never read this setting at all. Both vite.config.ts and vitest.config.ts declare the alias themselves:

resolve: { alias: { "@": path.resolve(__dirname, "./src") } }

so the change is type-level only.

Verification

  • tsc --noEmit: 0 errors before, 0 after, with @/ imports in 250 files under src/ still resolving — if the alias had broken, that would be hundreds of Cannot find module errors, not silence.
  • Re-ran the same config under TypeScript 6.0.3: the deprecation is gone, and no new diagnostic replaces it.

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.2, so `npm run typecheck` is quiet, but an
editor running a newer TypeScript flags it, and it becomes a hard failure
whenever the pin moves to 7.

baseUrl here only anchors `paths`, and `paths` has not needed it since
TypeScript 4.4 — entries resolve relative to the tsconfig that declares
them. Removing it means `"src/*"` has to be written `"./src/*"`, which is
the only other 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 config correct.

Nothing relies on baseUrl for bare-specifier resolution — there are no
`from "src/..."` style imports in src/. Both vite.config.ts and
vitest.config.ts declare the `@` alias themselves with
path.resolve(__dirname, "./src"), so build and tests never read this
setting at all; the change is type-level only.

Verified: `tsc --noEmit` reports 0 errors before and after, with `@/`
imports in 250 files under src/ still resolving. Re-checked under
TypeScript 6.0.3: the deprecation is gone and no new diagnostic replaces
it.
@github-actions github-actions Bot added the frontend Frontend (React/TypeScript) label Sep 7, 2026
@farion1231

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T02:08:14.644336Z 21e3830 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 21e3830893

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@farion1231 farion1231 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM, thanks for your contribution!

This branch has not been deployed

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

Labels

frontend Frontend (React/TypeScript)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants