diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 8fbea626eea..6c180921d4f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2056,7 +2056,7 @@ "category": "Error", "code": 5054 }, - "The project file name is not in 'tsconfig-*.json' format: '{0}'": { + "The project file name is not in 'tsconfig(-*).json' format: '{0}'": { "category": "Error", "code": 5055 }, diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 3aedd5efd11..67f7ee2aaad 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -186,11 +186,11 @@ namespace ts { } let fileOrDirectory = normalizePath(commandLine.options.project); - if (!fileOrDirectory || sys.directoryExists(fileOrDirectory)) { + if (!fileOrDirectory /* current directory */ || sys.directoryExists(fileOrDirectory)) { configFileName = combinePaths(fileOrDirectory, "tsconfig.json"); } else { - if (!/^tsconfig.*\.json$/.test(getBaseFileName(fileOrDirectory))) { + if (!/^tsconfig(?:-.*)?.json$/.test(getBaseFileName(fileOrDirectory))) { reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_project_file_name_is_not_in_tsconfig_Asterisk_json_format_Colon_0, commandLine.options.project)); return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); }