chore(ts): drop deprecated baseUrl from tsconfig.base.json
#101
Reference in New Issue
Block a user
Delete Branch "chore/typescript-drop-deprecated-baseurl"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Remove the deprecated
baseUrl: "."fromtsconfig.base.json. TypeScript 5.x flags it as deprecated; it stops functioning in TS 7.0. Since TS 5.0,pathskeys are resolved relative to the tsconfig file where they are declared whenbaseUrlis absent — and the repo root is exactly whatbaseUrl: "."was pointing at.Why this is a no-op
Our
pathsentries already start with./libs/shared/.../src/index.ts(relative to the repo root, which istsconfig.base.json's directory). With or withoutbaseUrl: ".", the resolver lands on the same files. No other tsconfig in the workspace declaresbaseUrl(onlytsconfig.base.jsondid), and the only path imports across the codebase are the workspace aliases (shared-ui,shared-state,shared-tokens,shared-util,feature-auth).rootDir: "."stays — it is independent of the deprecation and removing it would changedist/layout semantics across the workspace. Revisit only if a future TS version flags it.Verification
pnpm exec nx run-many -t lint test build --projects=portal-shell,portal-admin,shared-ui,shared-state,shared-tokens,shared-util— green across 6 projects.The IDE deprecation warning is gone.
baseUrlfrom tsconfig.base.jsonTypeScript 5.x flags `baseUrl` as deprecated; it stops functioning in TypeScript 7.0. Since TS 5.0, `paths` keys without a `baseUrl` are resolved relative to the tsconfig file where they are declared — in our case, the repo root, which is exactly what `baseUrl: "."` was buying us. Removing it is a no-op for module resolution. Our paths (`./libs/shared/tokens/src/index.ts`, …) already point at files relative to the repo root, so this is a pure cleanup: no other tsconfig in the workspace declares `baseUrl`, and the only path imports across the codebase are the workspace aliases (`shared-ui`, `shared-state`, `shared-tokens`, `shared-util`, `feature-auth`) which keep resolving correctly. `rootDir: "."` stays for now — it is independent of the deprecation and removing it would change `dist/` layout semantics across the workspace; revisit only if a future TS version flags it. Verified across portal-shell, portal-admin, shared-{ui,state, tokens,util} with lint + test + build — green.