diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a904d51..fad75bd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ Special thanks to the following contributors: @AndreKoepke, @andrezibaia, @bryan - Throw error when check_config fails. [#1928](https://github.com/MichMich/MagicMirror/issues/1928) - Bug fix related to 'maxEntries' not displaying Calendar events. [#2050](https://github.com/MichMich/MagicMirror/issues/2050) - Updated ical library to latest version. [#1926](https://github.com/MichMich/MagicMirror/issues/1926) +- Fix config check after merge of prettier [#2109](https://github.com/MichMich/MagicMirror/issues/2109) ## [2.11.0] - 2020-04-01 diff --git a/js/check_config.js b/js/check_config.js index 7ed6ea96..2bab5220 100644 --- a/js/check_config.js +++ b/js/check_config.js @@ -12,7 +12,6 @@ const path = require("path"); const fs = require("fs"); const rootPath = path.resolve(__dirname + "/../"); -const config = require(rootPath + "/.eslintrc.json"); const Log = require(rootPath + "/js/logger.js"); const Utils = require(rootPath + "/js/utils.js"); @@ -59,16 +58,15 @@ function checkConfigFile() { if (err) { throw err; } - const messages = linter.verify(data, config); + const messages = linter.verify(data); if (messages.length === 0) { - Log.log("Your configuration file doesn't contain syntax errors :)"); - return true; + Log.info(Utils.colors.pass("Your configuration file doesn't contain syntax errors :)")); } else { + Log.error(Utils.colors.error("Your configuration file contains syntax errors :(")); // In case the there errors show messages and return messages.forEach((error) => { - Log.log("Line", error.line, "col", error.column, error.message); + Log.error("Line", error.line, "col", error.column, error.message); }); - throw new Error("Wrong syntax in config file!"); } }); } diff --git a/js/utils.js b/js/utils.js index 74553f06..5044447d 100644 --- a/js/utils.js +++ b/js/utils.js @@ -10,7 +10,8 @@ var Utils = { colors: { warn: colors.yellow, error: colors.red, - info: colors.blue + info: colors.blue, + pass: colors.green } };