Skip to content

Commit fbf198e

Browse files
committed
Fix path display in not exported warnings
Resolves #1738
1 parent b878a9b commit fbf198e

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Fixed improper quoting of `as const` style enums, #1727.
1111
- Fixed handling of `@typeParam` on type aliases, #1733.
1212
- Fixed handling of comment tags on function type aliases, #1734.
13+
- Paths in warnings about non-exported symbols are now consistently displayed across platforms, #1738.
1314

1415
### Thanks!
1516

src/lib/validation/exports.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
SignatureReflection,
1111
TypeParameterReflection,
1212
} from "../models";
13-
import type { Logger } from "../utils";
13+
import { Logger, normalizePath } from "../utils";
1414

1515
function makeIntentionallyExportedHelper(
1616
intentional: readonly string[],
@@ -100,9 +100,8 @@ export function validateExports(
100100
decl.getSourceFile(),
101101
decl.getStart()
102102
);
103-
const file = relative(
104-
process.cwd(),
105-
decl.getSourceFile().fileName
103+
const file = normalizePath(
104+
relative(process.cwd(), decl.getSourceFile().fileName)
106105
);
107106

108107
logger.warn(

src/test/validation.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { equal, fail, ok } from "assert";
2-
import { join, relative } from "path";
2+
import { join } from "path";
33
import { Logger, LogLevel } from "..";
44
import { validateExports } from "../lib/validation/exports";
55
import { getConverter2App, getConverter2Program } from "./programs";
@@ -38,10 +38,7 @@ function expectWarning(
3838
equal(match[1], typeName, "Missing type name is different.");
3939
equal(
4040
match[2],
41-
relative(
42-
process.cwd(),
43-
join(__dirname, "converter2/validation", file)
44-
),
41+
`dist/test/converter2/validation/${file}`,
4542
"Referencing file is different."
4643
);
4744
equal(

0 commit comments

Comments
 (0)