Description
tsconfig.json has include: ["src"] and excludes test, so npm run build typechecks only src/. Vitest doesn't typecheck either — it strips types and runs. That means neither test/ nor scripts/ is ever seen by the compiler.
Surfaced during the review of #28 (@types/node 22 → 26), where it materially weakened the evidence: a green CI run says nothing about whether a types bump broke test/client/kosli-client.test.ts (which asserts on FormData/Blob) or scripts/generate-catalog.ts (which imports node:fs and node:url). Those are exactly the files a @types/node major is most likely to affect, and they're outside the compiler's view.
This matters more now that #38 pins @types/node to the Node floor: the pin is only enforceable if tsc actually sees the code that would break.
Proposal
- Add
tsconfig.typecheck.json extending tsconfig.json, with noEmit: true and include: ["src", "test", "scripts"].
- Add a
typecheck script: tsc --noEmit -p tsconfig.typecheck.json.
- Wire it into
ci.yml as its own step, so a failure is distinguishable from a build or test failure.
- Fix whatever it surfaces. Keep
strict: true — don't loosen the config to make errors go away.
Keep the existing tsconfig.json as the emit config so npm run build still produces dist/ from src/ alone.
Tasks
Description
tsconfig.jsonhasinclude: ["src"]and excludestest, sonpm run buildtypechecks onlysrc/. Vitest doesn't typecheck either — it strips types and runs. That means neithertest/norscripts/is ever seen by the compiler.Surfaced during the review of #28 (
@types/node22 → 26), where it materially weakened the evidence: a green CI run says nothing about whether a types bump broketest/client/kosli-client.test.ts(which asserts onFormData/Blob) orscripts/generate-catalog.ts(which importsnode:fsandnode:url). Those are exactly the files a@types/nodemajor is most likely to affect, and they're outside the compiler's view.This matters more now that #38 pins
@types/nodeto the Node floor: the pin is only enforceable iftscactually sees the code that would break.Proposal
tsconfig.typecheck.jsonextendingtsconfig.json, withnoEmit: trueandinclude: ["src", "test", "scripts"].typecheckscript:tsc --noEmit -p tsconfig.typecheck.json.ci.ymlas its own step, so a failure is distinguishable from a build or test failure.strict: true— don't loosen the config to make errors go away.Keep the existing
tsconfig.jsonas the emit config sonpm run buildstill producesdist/fromsrc/alone.Tasks
tsconfig.typecheck.jsontypechecknpm script