Improves handling of EOL whitespace error reporting

This commit is contained in:
Rick Waldron 2011-12-29 11:36:41 -05:00 committed by Dave Methvin
parent dd900460ac
commit b6a2dfbeb9

View File

@ -25,12 +25,12 @@ if ( jshint( src, config ) ) {
jshint.errors.forEach(function( e ) {
if ( !e ) { return; }
var str = e.evidence ? e.evidence : "";
var str = e.evidence ? e.evidence : "",
character = e.character === true ? "EOL" : "C" + e.character;
if ( str ) {
str = str.replace( /\t/g, " " ).trim();
console.log( " [L" + e.line + ":C" + e.character + "] " + e.reason + "\n " + str + "\n");
console.log( " [L" + e.line + ":" + character + "] " + e.reason + "\n " + str + "\n");
}
});
}