Skip to content

Commit 9e14831

Browse files
feat: add stylelint prefix to CLI output (#279)
1 parent 4167816 commit 9e14831

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
@@ -67,7 +67,8 @@ export default function linter(key, options, compilation) {
6767
}
6868
rawResults.push(
6969
lintFiles(files).catch((e) => {
70-
compilation.errors.push(e);
70+
// @ts-ignore
71+
compilation.errors.push(new StylelintError(e.message));
7172
return [];
7273
})
7374
);

0 commit comments

Comments
 (0)