diff --git a/src/StylelintError.js b/src/StylelintError.js index 2d7c3cc..54f226e 100644 --- a/src/StylelintError.js +++ b/src/StylelintError.js @@ -3,7 +3,7 @@ class StylelintError extends Error { * @param {string=} messages */ constructor(messages) { - super(messages); + super(`[stylelint] ${messages}`); this.name = 'StylelintError'; this.stack = ''; } diff --git a/src/linter.js b/src/linter.js index 872213f..3fe6e91 100644 --- a/src/linter.js +++ b/src/linter.js @@ -67,7 +67,8 @@ export default 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 []; }) );