Skip to content

Commit

Permalink
feat: add stylelint prefix to CLI output for better debugging (#273)
Browse files Browse the repository at this point in the history
* feat: add stylelint prefix to CLI output for better debugging

* fix: message
  • Loading branch information
ricardogobbosouza committed May 20, 2022
1 parent da40303 commit 4ce7da3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/StylelintError.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class StylelintError extends Error {
* @param {string=} messages
*/
constructor(messages) {
super(messages);
super(`[stylelint] ${messages}`);
this.name = 'StylelintError';
this.stack = '';
}
Expand Down
3 changes: 2 additions & 1 deletion src/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ function linter(key, options, compilation) {
}
rawResults.push(
lintFiles(files).catch((e) => {
compilation.errors.push(e);
// @ts-ignore
compilation.errors.push(new StylelintError(e.message));
return [];
})
);
Expand Down

0 comments on commit 4ce7da3

Please sign in to comment.