Skip to content

Commit 33aca82

Browse files
committed
Normalize configFileName on initialization
1 parent 98d72ce commit 33aca82

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,15 +442,17 @@ function readConfig (
442442
noProject?: boolean | null
443443
) {
444444
let config = { compilerOptions: {} as any }
445-
let basePath = cwd
445+
let basePath = normalizeSlashes(cwd)
446446
let configFileName: string | undefined = undefined
447447

448448
// Read project configuration when available.
449449
if (!noProject) {
450-
configFileName = project ? resolve(cwd, project) : ts.findConfigFile(normalizeSlashes(cwd), fileExists)
450+
configFileName = project
451+
? normalizeSlashes(resolve(cwd, project))
452+
: ts.findConfigFile(normalizeSlashes(cwd), fileExists)
451453

452454
if (configFileName) {
453-
const result = ts.readConfigFile(normalizeSlashes(configFileName), readFile)
455+
const result = ts.readConfigFile(configFileName, readFile)
454456

455457
if (result.error) {
456458
throw new TSError([formatDiagnostic(result.error, cwd, ts, 0)])

0 commit comments

Comments
 (0)