Setting up or modifying Typescript builds can be finicky. Here’s a collection of Typescript compiler (tsc) commands that are useful for debugging.

–showConfig

Official documentation.1

Print the compiler configuration and exit.

Useful for:

  • Debugging nested or extended tsconfigs, or check if CLI arguments are overriding tsconfig settings.

–listFiles

Official documentation.

Lists the files that are processed as part of the build.

NOTE: --listFilesOnly will list files and exit, if that’s all that’s needed.

Useful for:

  • Figuring out if your tsconfig include and exclude settings are working as expected.

–listEmittedFiles

Official documentation.

List the paths of all files generated from the build.

Useful for:

  • Check output file locations.
  • Check that expected files are being generated.

–traceResolution

Official documentation.

See what paths are considered when finding modules (module resolution) and which module ends up being picked.

Useful for:

  • Determining which paths are checked during module resolution when unable to find modules.
  • See if the correct module is picked up with nested packages, custom package locations, etc.

–diagnostics

Official documentation.

Breakdown of size project (files, lines of code, number of types, …) and compiler performance per compilation stage.

NOTE: This is a subset and user friendly version of --extendedDiagnostics.

Useful for:

  • Debug compiler performance.
  • See how big and cool your project is.