Skip to content

Commit

Permalink
Human readable Incompatible values for 'undefined' and 'undefined'
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
cytodev committed Oct 5, 2016
1 parent 944fbaa commit 104085b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/run.js
Expand Up @@ -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(" :: "));
}
Expand Down

0 comments on commit 104085b

Please sign in to comment.