Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

TypeScript · Command

tsc --noEmit

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.

How it works

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.

Syntax

tsc --noEmit [files...]

Parameters

NameTypeDescription
filespath...Optional TypeScript source files or project inputs to check; command-line file inputs take precedence over tsconfig.json discovery.

Returns

Exit status indicating whether compilation/type checking succeeded; no compiler output files are emitted when the flag is enabled.

Key points

  • The option suppresses JavaScript, source maps, and declaration output.
  • It supports workflows where Babel, SWC, or another tool performs the actual transformation.
  • TypeScript can remain responsible for editor services and static type analysis.

Common mistakes

  • --noEmit does not produce runnable JavaScript; a separate transpiler or bundler must handle conversion.

Example: Type-check without generating files

tsc --noEmit src/index.ts

Checks the specified TypeScript entry point and its imports without writing JavaScript, declarations, or source maps.

When to use it

Check types without creating build artifacts

CI validation

Let a separate bundler or transpiler generate JavaScript

Bundler pipeline

Use TypeScript for static analysis while another tool owns output

Editor and development tooling

Interview questions

QWhat does 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.

QWhy use --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.

QWhich generated artifacts does --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.

  • noEmit
  • emitDeclarationOnly
  • noEmitOnError
  • tsconfig.json
  • tsc CLI Options

Source: TSConfig Option: noEmit. Checked 2026-10-15.