fix(docs): silence TS 6 baseUrl deprecation in docs tsconfig#5920
fix(docs): silence TS 6 baseUrl deprecation in docs tsconfig#5920dokson wants to merge 1 commit into
baseUrl deprecation in docs tsconfig#5920Conversation
`packages/docs/tsconfig.json` sets `baseUrl: "."`, which TypeScript 6
flags as deprecated ("will stop functioning in TypeScript 7.0"). Vitest
4.x's typecheck integration surfaces the warning as an unhandled
source error, intermittently failing the `pnpm test` job under TS 6 /
TS latest:
TypeCheckError: Option 'baseUrl' is deprecated and will stop
functioning in TypeScript 7.0. Specify compilerOption
'"ignoreDeprecations" "6.0"' to silence this error.
❯ packages/docs/tsconfig.test.json:3:3
Commit 4e29983 already added a CI-time `jq` patch that injects
`"ignoreDeprecations": "6.0"` into `.configs/tsconfig.base.json` for
the TS 6 / latest matrix entries — but `packages/docs/tsconfig.json`
is standalone (it doesn't extend the base config), so the patch never
reaches the docs typecheck and the deprecation keeps surfacing.
Add the option directly to `packages/docs/tsconfig.json`. Three
consecutive local runs on TS 6.0.3 confirm the unhandled error is
gone deterministically (verified with `pnpm test` × 3).
|
Reviewed PR #5920 — approved. Single-line addition of Task list (3/3 completed)
|
|
TL;DR — Adds Key changes
Summary | 1 file | 1 commit | base:
|
There was a problem hiding this comment.
Reviewed — no issues found.
Task list (3/3 completed)
- Checkout PR and read the diff
- Investigate the change and verify correctness
- Submit review
Claude Opus | 𝕏
|
Closing in favour of a workflow-level fix. Root cause turned out to be commit e58ea4d (yesterday): the new A source-level fix doesn't compose: TS 5.5 only accepts The correct shape is a TS-version-conditional |
Summary
Fixes the intermittent
pnpm testfailure on theTest with TypeScript 6andTest with TypeScript latestCI jobs, caused by abaseUrldeprecation inpackages/docs/tsconfig.jsonthat vitest 4.x surfaces as an unhandled source error.Problem
Under TypeScript 6,
"baseUrl": "."emits a deprecation:Vitest 4.x's typecheck integration catches the warning and re-emits it as an "Unhandled Source Error", which fails the test runner with exit 1 even when every test passes (
Tests 3791 passed (3791),Type Errors no errors,Errors 1 error). Whether the error is caught vs. dropped depends on worker timing, so different PRs see different outcomes for the same underlying state — same TypeScript version (6.0.3), same vitest (4.1.5):Why the existing CI patch doesn't cover this
Commit 4e29983 (
fix ci with "ignoreDeprecations": "6.0" in TypeScript 7) already adds ajqstep to the workflow that injectsignoreDeprecations: "6.0"into.configs/tsconfig.base.jsonfor the TS 6 / latest matrix entries. That patch handlespackages/zod's typechecks fine.But
packages/docs/tsconfig.jsonis standalone — it doesn'textends.configs/tsconfig.base.json— so the workflow'sjqpatch never reaches it, andpackages/docs/tsconfig.test.json(which extends the docs tsconfig) keeps surfacing the deprecation under TS 6+.Fix
One line: add
"ignoreDeprecations": "6.0"topackages/docs/tsconfig.json. This is the documented mitigation in the deprecation message itself, and is the same value the workflow'sjqstep injects elsewhere.{ "compilerOptions": { + "ignoreDeprecations": "6.0", "baseUrl": ".",Verification
Reproduced locally with TS 6.0.3 + vitest 4.1.5. Before the fix, the unhandled error appears on most runs but not all (consistent with the cross-PR pattern above). After the fix, three consecutive
pnpm testruns all complete without the error:No
Errors 1 errorline in any run. The1 failedis the unrelated Windows-onlyredos checkerflake that PR #5919 fixes; it is not caused by this PR.Scope
packages/docs/tsconfig.json(+1 line).Alternative considered
Extending the workflow's
jqstep to also patchpackages/docs/tsconfig.jsonwould work but spreads the same workaround across two places and ties unrelated jobs together. Setting it in the source file is one line and self-documenting. Happy to switch to the workflow approach if preferred.