Repository navigation
test: fix broken typecheck script and add regression test - #405
Conversation
tsconfig.json extends @docusaurus/tsconfig, which still sets baseUrl. typescript ~7.0.2 removed that option entirely (TS5102), so npm run typecheck has been failing immediately with zero signal anywhere. Override the inherited baseUrl to null in our own compilerOptions to strip it from the merged config tsc evaluates. Add scripts/typecheck.test.mjs, which shells out to npx tsc --noEmit and asserts a zero exit code, so this is covered by the existing scripts/**/*.test.mjs glob in test:unit with no CI workflow change needed. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
✅ Deploy Preview for cncf-techdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Verified end-to-end; this looks correct to me.
- Reproduced the bug: with
origin/main'stsconfig.json,npx tsc --noEmitfails withTS5102: Option 'baseUrl' has been removedat tsconfig.json:4 (inherited from@docusaurus/[email protected], which setsbaseUrl: ".", under the repo'stypescript ~7.0.2pin). - With this PR's
tsconfig.json("baseUrl": nulloverride, tsconfig.json:10),npx tsc --noEmitexits 0 — thenulloverride does strip the inherited key from the merged config, as the body claims. scripts/typecheck.test.mjspasses under the same flagstest:unituses (node --experimental-strip-types --experimental-test-module-mocks --test), and the existingscripts/**/*.test.mjsglob in package.json:40 picks it up with no workflow change.
One note, not a defect: the regression test shells out to npx tsc --noEmit against the whole repo, so test:unit duration now includes a full typecheck (~a few seconds locally). Seems a fair trade for making a previously-dead script load-bearing.
Scope matches the body: fixes the local script + adds the test; CI wiring correctly deferred to #390. No trust surfaces touched.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
Test Improvement
npm run typecheck(tsc) has been failing immediately with:tsconfig.jsonextends@docusaurus/tsconfig, which still setsbaseUrl: "."; this repo's devDependencytypescriptis pinned to~7.0.2, which removed that option outright, so the inherited valuehard-errors. The script was never invoked anywhere (local or CI), so this
had zero signal.
This PR overrides the inherited
baseUrltonullin our owncompilerOptions(TS mergesextendsconfigs, andnullstrips theinherited key), which makes
npm run typecheckexit 0 cleanly again. Italso adds
scripts/typecheck.test.mjs, a regression test that shells outto
npx tsc --noEmitand asserts a zero exit code — verified to failagainst the pre-fix
tsconfig.jsonand pass against the fix. It's pickedup automatically by the existing
scripts/**/*.test.mjsglob intest:unit, so no.github/workflows/change is needed for this part.npm run test:coveragestill reports 100% stmts/branch/funcs/lines acrossall included files.
Related Issue
Part of #390 (the hive consolidated a new issue for this finding into the
existing #390 tracker as the same format-check.yml-related component; this
PR only fixes the local typecheck-script bug and adds a regression test —
wiring
npm run typecheckinto actual CI still needs a.github/workflows/change this lane's contributor-tier token cannotpush, same as the rest of #390)
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88