- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Description
From #54500:
Currently if you run
tsc foo.tsin a folder where atsconfig.jsonexists, thetsconfigfile is completely ignored. This is very confusing. The intended meaning of this is also unclear; it could be that you want to use thecompilerOptionsof the config but not thefilesand/orincludeand/orexclude.For clarity, in 6.0, if you run
tscin a directory with atsconfig.json, an error will be issued instead.
tsconfig.jsonis present but will not be loaded if files are specified on the commandline. Use--ignore-configto skip this error
Basically, it should be okay to run
- tsc -p tsconfig.json [other options]- the user has explicitly opted into using the- tsconfig.json, but wants to override some options (even files)
- tscwith 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 --ignoreProjectinstead 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.