From 104085b46d192ae6e934364b77838dd8f0f53d59 Mon Sep 17 00:00:00 2001 From: Roel Walraven Date: Wed, 5 Oct 2016 12:02:04 +0200 Subject: [PATCH] Human readable Incompatible values for 'undefined' and 'undefined' The issue with 'undefined' and 'undefined' probably lies deeper than a simple raw error message, but this commit at least makes them readable. Where you would usually get the message "Incompatible values for the 'undefined' of 'undefined' linting options" you will now be able to pinpoint the error with actual fields e.g. "Incompatible values for the 'strict' of 'globalstrict' linting options". --- scripts/run.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/run.js b/scripts/run.js index 09dfb78..783e201 100644 --- a/scripts/run.js +++ b/scripts/run.js @@ -194,11 +194,13 @@ function doLint(data, options, globals, lineOffset, charOffset) { // Do some formatting if the error data is available. if (e.raw) { - var message = e.raw - .replace("{a}", e.a) - .replace("{b}", e.b) - .replace("{c}", e.c) - .replace("{d}", e.d); + var message = e.reason; + + if(e.a !== undefined && e.b !== undefined && e.c !== undefined && e.d !== undefined) + message = e.raw.replace("{a}", e.a) + .replace("{b}", e.b) + .replace("{c}", e.c) + .replace("{d}", e.d); console.log([e.line + lineOffset, e.character + charOffset, message].join(" :: ")); }