Skip to content

Commit 70fd420

Browse files
committed
use eslint/prettier like error reporting
to see if GitHub picks up errors in UI
1 parent 4e137cc commit 70fd420

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

tools/respec2html.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,25 @@ class Logger {
4848
* @param {RsError} rsError
4949
*/
5050
error(rsError) {
51-
const header = colors.bgRed.white.bold("[ERROR]");
5251
const message = colors.red(this._formatMarkdown(rsError.message));
53-
console.error(header, message);
54-
if (rsError.plugin) {
55-
this._printDetails(rsError);
52+
if (rsError.location) {
53+
for (const loc of rsError.location) {
54+
const [file, lineNumber] = loc.split(":");
55+
console.error(file);
56+
console.error(` ${lineNumber}:0`, "error", message);
57+
}
5658
}
5759
}
5860

5961
/** @param {RsError} rsError */
6062
warn(rsError) {
61-
const header = colors.bgYellow.black.bold("[WARNING]");
6263
const message = colors.yellow(this._formatMarkdown(rsError.message));
63-
console.error(header, message);
64-
if (rsError.plugin) {
65-
this._printDetails(rsError);
64+
if (rsError.location) {
65+
for (const loc of rsError.location) {
66+
const [file, lineNumber] = loc.split(":");
67+
console.error(file);
68+
console.error(` ${lineNumber}:0`, "warning", message);
69+
}
6670
}
6771
}
6872

0 commit comments

Comments
 (0)