From dff679dbf2f45ffd7a90b6f66704e607f48ece83 Mon Sep 17 00:00:00 2001 From: Alec Larson Date: Sun, 29 Apr 2018 22:08:20 -0400 Subject: [PATCH] fix: alert the user about unknown rule errors https://github.com/sasstools/sass-lint/blob/master/lib/rules.js#L61 With this change, the user will get a linter error they can act on without opening the devtools. --- lib/main.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/main.coffee b/lib/main.coffee index b703f1a..4ca50f7 100644 --- a/lib/main.coffee +++ b/lib/main.coffee @@ -173,9 +173,14 @@ module.exports = else # Leaving this here to allow people to report the errors console.log('linter-sass-lint', error) + + # Unknown rules are forwarded to the user. + if /Rule `[\w-]+` could not be found/.test error.message + text = error.message + return [ type: 'Error' - text: 'Unexpected parse error in file' + text: text or 'Unexpected parse error in file' filePath: filePath range: [[lineIdx, 0], [lineIdx, colEndIdx]] ]