20

Is there a way to print the options used by tsc? I feel like it doesn't take my tsconfig.json into account and I'm looking for a flag that would allow me to know what kind of options it's trying to use.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Loic Coenen
  • 773
  • 3
  • 8
  • 19
  • I recommend you to make a new question asking why tsc is not doing what you want to do with detailed information instead. – lilezek May 09 '18 at 20:57
  • Similar question that may help: [Why is the TypeScript compiler ignoring tsconfig.json?](https://stackoverflow.com/q/39399057/) [tsconfig.json not used by TypeScript compiler?](https://stackoverflow.com/q/33243678/) – snipsnipsnip May 10 '18 at 09:11

3 Answers3

30
tsc --showConfig

will show the complete config that will be used for compilation.

The --showConfig flag has been added in typescript 3.2:

TypeScript will calculate the effective tsconfig.json (after calculating options inherited from the extends field) and print that out. This can be useful for diagnosing configuration issues in general.

Description from the compiler options documentation:

Rather than actually execute a build with the other input options and config files, show the final implied config file in the output.

TmTron
  • 17,012
  • 10
  • 94
  • 142
6

Currently there is no option to dump the loaded configuration.

You may want to upvote the issue:

Edit: tsc --showConfig has been implemented as of v3.2.1.

snipsnipsnip
  • 2,268
  • 2
  • 33
  • 34
0

I think you should provide a better question maybe with some more information, like what your tsconfig.json looks like, where is it placed, is it in the root of the project, are there any errors on compile etc.

The simplest way to test if Typescript compiler takes your tsconfig.json in consider is to make a typo in that JSON or make that JSON not valid. If Typescript compiler uses your tsconfig.json then it will fail with an error.

Tomislav
  • 722
  • 6
  • 6