-
Notifications
You must be signed in to change notification settings - Fork 13k
Description
From #54500:
Currently if you run
tsc foo.ts
in a folder where atsconfig.json
exists, thetsconfig
file is completely ignored. This is very confusing. The intended meaning of this is also unclear; it could be that you want to use thecompilerOptions
of the config but not thefiles
and/orinclude
and/orexclude
.For clarity, in 6.0, if you run
tsc
in a directory with atsconfig.json
, an error will be issued instead.
tsconfig.json
is present but will not be loaded if files are specified on the commandline. Use--ignore-config
to skip this error
Basically, it should be okay to run
tsc -p tsconfig.json [other options]
- the user has explicitly opted into using thetsconfig.json
, but wants to override some options (even files)tsc
with no options - regardless of what is run (probably continue just show a basic help screen)
But if you run without -p
/--project
, you should receive an error if there is a tsconfig.json
present and it may be a mistake to build without your project; and that if it was intentional to ignore it, specify --ignoreConfig
.
About --ignoreConfig
- It should be okay to have this option even if there is no tsconfig in the CWD
- I don't know if it should be called
--ignoreProject
instead of--ignoreConfig
- I don't know if we can error if this option is specified within the
tsconfig.json
, but that probably would be ideal.