Skip to content

Commit 4ce7da3

Browse files
feat: add stylelint prefix to CLI output for better debugging (#273)
* feat: add stylelint prefix to CLI output for better debugging * fix: message
1 parent da40303 commit 4ce7da3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/StylelintError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class StylelintError extends Error {
33
* @param {string=} messages
44
*/
55
constructor(messages) {
6-
super(messages);
6+
super(`[stylelint] ${messages}`);
77
this.name = 'StylelintError';
88
this.stack = '';
99
}

src/linter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ function linter(key, options, compilation) {
7373
}
7474
rawResults.push(
7575
lintFiles(files).catch((e) => {
76-
compilation.errors.push(e);
76+
// @ts-ignore
77+
compilation.errors.push(new StylelintError(e.message));
7778
return [];
7879
})
7980
);

0 commit comments

Comments
 (0)