Skip to content

Commit 4b32e9d

Browse files
committed
use color
1 parent 5bcad29 commit 4b32e9d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dictionary/build.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@ function displayError(
5959
throw error;
6060
}
6161
}
62+
const sourceStyle = color ? "color: blue" : "";
6263
for (const error of errors) {
6364
console.error(`Error: ${error.message}`);
6465
if (error instanceof PositionedError) {
6566
const position = error.position;
6667
const lines = source.slice(0, position?.position).split(/\r?\n/);
6768
const line = lines.length;
6869
const column = lines[lines.length - 1].length + 1;
69-
console.error(` at ${SOURCE}:${line}:${column}`);
70+
console.error(` at %c${SOURCE}:${line}:${column}`, sourceStyle);
7071
console.error();
7172
}
7273
}

0 commit comments

Comments
 (0)