Check types without creating build artifacts
CI validation
TypeScript · Command
tsc --noEmit type-checks a TypeScript program without generating JavaScript, source maps, or declaration files. It is commonly used when another tool performs transpilation or bundling.
The --noEmit compiler flag makes TypeScript perform compilation checks while suppressing compiler output. It is useful when another tool, such as a bundler or transpiler, produces runnable JavaScript, while TypeScript remains responsible for type checking and editor integration.
tsc --noEmit [files...]| Name | Type | Description |
|---|---|---|
files | path... | Optional TypeScript source files or project inputs to check; command-line file inputs take precedence over tsconfig.json discovery. |
Exit status indicating whether compilation/type checking succeeded; no compiler output files are emitted when the flag is enabled.
--noEmit does not produce runnable JavaScript; a separate transpiler or bundler must handle conversion.tsc --noEmit src/index.tsChecks the specified TypeScript entry point and its imports without writing JavaScript, declarations, or source maps.
CI validation
Bundler pipeline
Editor and development tooling
tsc --noEmit do?It suppresses compiler output files while still allowing TypeScript to check the program. The option applies to JavaScript output, source maps, and declaration files.
Follow-up: How would another tool fit into this setup? A bundler or transpiler can convert the checked TypeScript into JavaScript while TypeScript remains the type checker.
--noEmit in a large codebase?Use tsc --noEmit when TypeScript should provide type checking but another tool should generate runtime JavaScript. This separates static analysis from output generation.
Follow-up: What configuration concern matters when invoking tsc? Supplying input files on the command line causes tsconfig.json files to be ignored.
--noEmit suppress?The flag disables emitted JavaScript, source maps, and declarations, so it is broader than merely disabling JavaScript output. The compiler still processes the program for checking.
Follow-up: How does this differ from noEmitOnError? noEmitOnError conditionally suppresses output only when errors occur, whereas noEmit disables output for the compilation.
noEmitemitDeclarationOnlynoEmitOnErrortsconfig.jsontsc CLI Options