Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Commit da3217c

Browse files
authored
Merge pull request #387 from markwpearce/feature/relative-path-errors
feat: Ensure errors are outputted as relative paths (i.e. begin with './')
2 parents 3794dc5 + a160242 commit da3217c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/__test__/error.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ spec(__filename, async function() {
1717
let stats = await compile(webpackConfig());
1818

1919
expectErrors(stats, 1, [
20+
'./src/index.ts',
2021
`Argument of type '"test"' is not assignable to parameter of type 'number'`
2122
]);
2223

src/checker/runtime.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
407407
.filter(diag => !ignoreDiagnostics[diag.code])
408408
.map(diagnostic => {
409409
const message = compiler.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
410-
const fileName = diagnostic.file && path.relative(context, diagnostic.file.fileName);
410+
const fileName = diagnostic.file && './'+path.relative(context, diagnostic.file.fileName);
411+
411412
let pretty = '';
412413
let line = 0;
413414
let character = 0;

0 commit comments

Comments
 (0)