Skip to content

Commit 00a373a

Browse files
committed
update regex for filename
1 parent 04d73ba commit 00a373a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2056,7 +2056,7 @@
20562056
"category": "Error",
20572057
"code": 5054
20582058
},
2059-
"The project file name is not in 'tsconfig-*.json' format: '{0}'": {
2059+
"The project file name is not in 'tsconfig(-*).json' format: '{0}'": {
20602060
"category": "Error",
20612061
"code": 5055
20622062
},

src/compiler/tsc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ namespace ts {
186186
}
187187

188188
let fileOrDirectory = normalizePath(commandLine.options.project);
189-
if (!fileOrDirectory || sys.directoryExists(fileOrDirectory)) {
189+
if (!fileOrDirectory /* current directory */ || sys.directoryExists(fileOrDirectory)) {
190190
configFileName = combinePaths(fileOrDirectory, "tsconfig.json");
191191
}
192192
else {
193-
if (!/^tsconfig.*\.json$/.test(getBaseFileName(fileOrDirectory))) {
193+
if (!/^tsconfig(?:-.*)?.json$/.test(getBaseFileName(fileOrDirectory))) {
194194
reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_project_file_name_is_not_in_tsconfig_Asterisk_json_format_Colon_0, commandLine.options.project));
195195
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
196196
}

0 commit comments

Comments
 (0)