mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
show an error if --showConfig is enabled and tsconfig.json does not exist (#35723)
This commit is contained in:
parent
a39a675696
commit
320adf5ce0
@ -3329,6 +3329,10 @@
|
||||
"category": "Error",
|
||||
"code": 5080
|
||||
},
|
||||
"Cannot find a tsconfig.json file at the current directory: {0}.": {
|
||||
"category": "Error",
|
||||
"code": 5081
|
||||
},
|
||||
|
||||
"Generates a sourcemap for each corresponding '.d.ts' file.": {
|
||||
"category": "Message",
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user