tsc --noEmit: Typecheck Gate in CI
tsc --noEmit runs the TypeScript compiler purely to report type errors, writing no output, which makes it a clean CI gate.
Fast transpilers (esbuild, swc, Vite) strip types without checking them, so tsc --noEmit is what actually catches type errors in a pipeline.
What it does
tsc --noEmit compiles the project for type checking only and produces no .js or .d.ts. It exits non-zero if any type error exists, which is exactly what you want as a gate before building or deploying.
Common usage
tsc --noEmit
tsc --noEmit -p tsconfig.build.json
# faster gate on big projects
tsc --noEmit --skipLibCheckOptions
| Flag | What it does |
|---|---|
| --noEmit | Type-check only, emit nothing |
| -p, --project <f> | Use a specific tsconfig |
| --skipLibCheck | Skip checking .d.ts files (faster, less strict) |
| --pretty false | Plain output for cleaner CI logs |
| --incremental | Cache type info (needs an emit or tsBuildInfoFile) |
In CI
Run tsc --noEmit as a dedicated step separate from the bundler build so type errors fail fast and clearly. --skipLibCheck trades a little safety for a big speed win on projects with many dependencies. Cache node_modules and any tsBuildInfo file.
Common errors in CI
"error TS2307: Cannot find module \"X\" or its corresponding type declarations" means missing @types or a bad path. "error TS18003: No inputs were found in config file" means the include globs match nothing (wrong project). "error TS2532: Object is possibly undefined" and similar strictness errors often appear only in CI when local editors have looser settings than the committed tsconfig.