TypeScript Reference ยท The tsc Command Line
tsc --showConfig
Reference for tsc --showConfig: print the fully resolved configuration after extends, defaults and command-line overrides, and use it to debug surprises.
tsc --showConfig prints the configuration tsc would use, as JSON, and then exits without compiling. The output has extends already merged, relative paths expanded, command-line overrides applied, and the final list of files included.
It answers the question "why is my project behaving like this?" faster than reading three nested config files. It is especially useful in monorepos where options come from a base config several folders up.
tsc --showConfig tsc -p tsconfig.build.json --showConfig tsc --showConfig --strict false
Try it
The resolved config is what decides the errors you see. Here is code whose result depends on strict-family options; this site always runs with --strict.
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.
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
tsc --showConfig [-p <path>] [options]
Typical output (abbreviated):
{ "compilerOptions": { "strict": true, "target": "es2022", "module": "nodenext" }, "files": [ "./src/index.ts", "./src/util.ts" ] }
Behavior:
- Paths are shown relative to the config file.
- Options set only by default are generally not listed; you see what was explicitly set, directly or through
extends. includeandexcludeare replaced by the expandedfileslist.- Command-line options appear in
compilerOptions, so you can preview a flag.
Edge cases: if there is no tsconfig and no files are given, it reports that it cannot find one. Syntax errors in the config are reported instead of JSON.
Usage notes
- Debug
extendschains. If an option does not take effect, check whether a later config overrides it. - Check
filesfor surprises. Missing files meanincludepatterns do not match; unexpected files meanexcludeis too narrow. - Diff configs. Redirect the output to a file for two projects and compare them.
- For the file list only,
--listFilesOnlyis closer to what the compiler really loads, including declaration files fromnode_modules. - Safe to run anywhere: it never writes build output.