mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
show an error if --showConfig is enabled and tsconfig.json does not exist (#35723)
This commit is contained in:
committed by
Daniel Rosenwasser
parent
a39a675696
commit
320adf5ce0
@@ -241,9 +241,15 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (commandLine.fileNames.length === 0 && !configFileName) {
|
||||
printVersion(sys);
|
||||
printHelp(sys, getOptionsForHelp(commandLine));
|
||||
return sys.exit(ExitStatus.Success);
|
||||
if (commandLine.options.showConfig) {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0, normalizePath(sys.getCurrentDirectory())));
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
}
|
||||
else {
|
||||
printVersion(sys);
|
||||
printHelp(sys, getOptionsForHelp(commandLine));
|
||||
return sys.exit(ExitStatus.Success);
|
||||
}
|
||||
}
|
||||
|
||||
const currentDirectory = sys.getCurrentDirectory();
|
||||
|
||||
Reference in New Issue
Block a user