Skip to content

Commit fc40e7c

Browse files
committed
fix(lint): dynamically resolve rootDir for Windows compatibility
1 parent fd1f878 commit fc40e7c

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

packages/lint/linthost/config.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,13 @@ func typeScriptConfigLoaderTsconfig(loader, location, outDir string) string {
13531353
"noImplicitAny": false,
13541354
"outDir": filepath.ToSlash(filepath.Join(outDir, "out")),
13551355
"rewriteRelativeImportExtensions": true,
1356-
"rootDir": "/",
1356+
"rootDir": func() string {
1357+
vol := filepath.VolumeName(outDir)
1358+
if vol == "" {
1359+
return "/"
1360+
}
1361+
return filepath.ToSlash(vol + "\\")
1362+
}(),
13571363
"skipLibCheck": true,
13581364
"strict": false,
13591365
"target": "ES2022",

packages/lint/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ function evaluateTtsxConfigPlugins(
564564
noImplicitAny: false,
565565
outDir: path.join(tempDir, "out").replace(/\\/g, "/"),
566566
rewriteRelativeImportExtensions: true,
567-
rootDir: "/",
567+
rootDir: path.parse(tempDir).root.replace(/\\/g, "/"),
568568
skipLibCheck: true,
569569
strict: false,
570570
target: "ES2022",

0 commit comments

Comments
 (0)