foundation

Typecheck

Run TypeScript checking as a separate CI gate so fast transforms do not hide contract errors.

Typecheck is a semantic gate. Many JavaScript build tools transpile TypeScript quickly without checking contracts, so CI should run `tsc --noEmit`, `vue-tsc`, or the framework type checker explicitly.

					{
  "scripts": {
    "build": "vite build",
    "typecheck": "tsc -p tsconfig.json --noEmit"
  }
}
				

Vite, SWC, esbuild, and Babel can produce bundles while type errors remain. In monorepos, project references and incremental builds help scale typecheck without hiding errors in generated `.d.ts` files.

On interviews: why transpile-only builds pass with TypeScript errors, separating `build` from `typecheck`, and project references for large repos.

Common pitfalls: skipping typecheck because the bundle builds moves contract failures to runtime or package consumers; stale generated declarations misleading dependents.

The trade-off is pipeline speed versus catching API and contract errors before merge.

Checklist:

  • Run semantic type checking in CI.
  • Check declarations for published packages.
  • Use incremental builds or project references at scale.
  • Never treat fast transpilers as type checkers.