@@ -301,19 +301,19 @@ namespace ts {
301301 }
302302
303303 const fileOrDirectory = normalizePath ( commandLine . options . project ) ;
304- if ( ! fileOrDirectory /* current directory */ || sys . directoryExists ( fileOrDirectory ) ) {
304+ if ( ! fileOrDirectory /* current directory "." */ || sys . directoryExists ( fileOrDirectory ) ) {
305305 configFileName = combinePaths ( fileOrDirectory , "tsconfig.json" ) ;
306+ if ( ! sys . fileExists ( configFileName ) ) {
307+ reportDiagnostic ( createCompilerDiagnostic ( Diagnostics . Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0 , commandLine . options . project ) , /* compilerHost */ undefined ) ;
308+ return sys . exit ( ExitStatus . DiagnosticsPresent_OutputsSkipped ) ;
309+ }
306310 }
307311 else {
308- if ( ! / ^ t s c o n f i g (?: - .* ) ? \. j s o n $ / . test ( getBaseFileName ( fileOrDirectory ) ) ) {
309- reportDiagnostic ( createCompilerDiagnostic ( Diagnostics . The_project_file_name_is_not_in_tsconfig_Asterisk_json_format_Colon_0 , commandLine . options . project ) , /* compilerHost */ undefined ) ;
312+ configFileName = fileOrDirectory ;
313+ if ( ! sys . fileExists ( configFileName ) ) {
314+ reportDiagnostic ( createCompilerDiagnostic ( Diagnostics . The_specified_path_does_not_exist_Colon_0 , commandLine . options . project ) , /* compilerHost */ undefined ) ;
310315 return sys . exit ( ExitStatus . DiagnosticsPresent_OutputsSkipped ) ;
311316 }
312- configFileName = fileOrDirectory ;
313- }
314- if ( ! sys . fileExists ( configFileName ) ) {
315- reportDiagnostic ( createCompilerDiagnostic ( Diagnostics . Cannot_find_any_project_file_in_specified_path_Colon_0 , commandLine . options . project ) , /* compilerHost */ undefined ) ;
316- return sys . exit ( ExitStatus . DiagnosticsPresent_OutputsSkipped ) ;
317317 }
318318 }
319319 else if ( commandLine . fileNames . length === 0 && isJSONSupported ( ) ) {
0 commit comments