Skip to content

Commit a158b7e

Browse files
authored
Fix implicit glob detection when ancestor directory contains . (#47418)
1 parent ce18254 commit a158b7e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3509,7 +3509,7 @@ namespace ts {
35093509
? WatchDirectoryFlags.Recursive : WatchDirectoryFlags.None
35103510
};
35113511
}
3512-
if (isImplicitGlob(spec)) {
3512+
if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
35133513
return {
35143514
key: useCaseSensitiveFileNames ? spec : toFileNameLowerCase(spec),
35153515
flags: WatchDirectoryFlags.Recursive

src/testRunner/unittests/config/tsconfigParsing.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,5 +412,14 @@ namespace ts {
412412
Diagnostics.Compiler_option_0_requires_a_value_of_type_1.code,
413413
/*noLocation*/ true);
414414
});
415+
416+
it("parses wildcard directories even when parent directories have dots", () => {
417+
const parsed = parseConfigFileTextToJson("/foo.bar/tsconfig.json", JSON.stringify({
418+
include: ["src"]
419+
}));
420+
421+
const parsedCommand = parseJsonConfigFileContent(parsed.config, sys, "/foo.bar");
422+
assert.deepEqual(parsedCommand.wildcardDirectories, { "/foo.bar/src": WatchDirectoryFlags.Recursive });
423+
});
415424
});
416425
}

0 commit comments

Comments
 (0)