diff --git a/src/StylelintError.js b/src/StylelintError.js index eedb901..b6a92c0 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 d37e13b..dd0a5f4 100644 --- a/src/linter.js +++ b/src/linter.js @@ -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 []; }) );