Skip to content
Tutorials Center
My learning

Topics

TypeScript Reference ยท The tsc Command Line

tsc --help and --all

Reference for tsc --help (-h) and --all: the built-in documentation for compiler options, how to see the full list, and how to read the output.

tsc --help (short form -h) prints a summary of the command-line usage and the most commonly used options, grouped by purpose. Add --all to list every compiler option the installed version supports. Because the output comes from the compiler itself, it always matches the version you have, unlike a web page that may describe another one.

tsc also prints its help when run in a folder with no tsconfig.json and no file names.

TEXT
tsc --help
tsc -h
tsc --all
tsc --help --all

Try it

Help lists options such as strict, target and lib. You can see the effect of one of them directly: here the same code is checked under this site's --strict setting.

TypeScript An option from the help text in action

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or readFileSync(0)), it gets the next line from this box.

TypeScript Satisfying strictPropertyInitialization

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or readFileSync(0)), it gets the next line from this box.

Syntax

TEXT
tsc --help [--all]
tsc --all
Flag Description
-h, --help Print usage, common commands and the most used options.
--all Print every option, including rarely used ones, with short descriptions and defaults.

What the output contains: a short list of common commands (tsc, tsc --init, tsc -p, tsc --help --all), then options grouped as Command-line Options, Modules, Emit, JavaScript Support, Editor Support, Interop Constraints, Type Checking, Language and Environment, Projects, Output Formatting and Watch Options. Each entry names the flag, its type (boolean, string, list, or a set of allowed values) and a default.

Edge cases: some options exist only in tsconfig.json, not on the command line, and are marked accordingly. The help can be shown in another language with --locale.

Usage notes

  • Search it: pipe to a pager or grep, for example tsc --all | grep -i decorator.
  • Check availability before upgrading. If an option from a blog post is missing from --all, your compiler is older (or newer) than the post.
  • Type-checking options are the group most teams care about; compare it with strict.
  • Exit status of the help command is 0.
  • For the version itself use tsc --version.