tsc Command: Compile TypeScript in CI
tsc type-checks TypeScript and emits JavaScript (and declaration files).
tsc is the TypeScript compiler and the standard type-check gate in CI. Many pipelines run it with --noEmit purely to catch type errors, while build pipelines use it (or --build for project references) to emit JS and .d.ts files.
Common flags
--noEmit- type-check only, do not write output (common CI gate)-p/--project PATH- use a specific tsconfig.json--build/-b- build project references incrementally--outDir DIR- output directory for emitted JS--strict- enable all strict type-checking options--watch- recompile on file changes (local, not CI)--incremental- reuse .tsbuildinfo for faster rebuilds
Example in CI
Run a pure type-check gate against the project tsconfig:
shell
tsc --noEmit -p tsconfig.jsonCommon errors in CI
- error TS2307: Cannot find module 'X' or its corresponding type declarations
- error TS2304: Cannot find name 'X' - missing import or lib option
- error TS2345: Argument of type A is not assignable to parameter of type B
- error TS5023: Unknown compiler option 'X' - typo or version mismatch in tsconfig
Key takeaways
tsc --noEmitis the canonical CI type-check that emits nothing.- Use
--build/-bfor monorepos with project references. - TS2307/TS2304 are the most common CI failures (missing module or name).
Related guides
esbuild Command: Bundle & Compile in CIesbuild is a fast Go-based bundler/compiler. Reference for --bundle, --outfile, --minify, --platform, --targe…
swc Command: Fast JS/TS Compile in CIswc is a Rust-based JS/TS compiler. Reference for --out-dir, --config-file, --source-maps, -C options, and th…
babel Command: Transpile JS in CIbabel transpiles modern JavaScript and JSX. Reference for --out-dir, --out-file, --config-file, --extensions,…