Skip to content

Commit 9fa7d8b

Browse files
committed
Use getNormalizedAbsolutePath to combine basePath and config value for file names
Fixes #34502 by being consistent in path normalization
1 parent a4044ca commit 9fa7d8b

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,7 @@ namespace ts {
25332533

25342534
function normalizeNonListOptionValue(option: CommandLineOption, basePath: string, value: any): CompilerOptionsValue {
25352535
if (option.isFilePath) {
2536-
value = normalizePath(combinePaths(basePath, value));
2536+
value = getNormalizedAbsolutePath(value, basePath);
25372537
if (value === "") {
25382538
value = ".";
25392539
}

src/tsc/executeCommandLine.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,9 @@ namespace ts {
241241
}
242242

243243
const currentDirectory = sys.getCurrentDirectory();
244-
const getCanonicalFileName = createGetCanonicalFileName(sys.useCaseSensitiveFileNames);
245244
const commandLineOptions = convertToOptionsWithAbsolutePaths(
246245
commandLine.options,
247-
fileName => toPath(fileName, currentDirectory, getCanonicalFileName)
246+
fileName => getNormalizedAbsolutePath(fileName, currentDirectory)
248247
);
249248
if (configFileName) {
250249
const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, sys, reportDiagnostic)!; // TODO: GH#18217

tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@
33
exitCode:: ExitStatus.Success
44

55

6-
//// [/src/project/built/src/main.js] file written with same contents
7-
//// [/src/project/built/tsconfig.tsbuildinfo] file written with same contents

0 commit comments

Comments
 (0)