Skip to content

Commit

Permalink
Merge pull request jshint#418 from goatslacker/jshintgh-340
Browse files Browse the repository at this point in the history
Adds a warning when laxcomma is not set
  • Loading branch information
valueof committed Jan 12, 2012
2 parents 00f0150 + d801892 commit 936f6fa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jshint.js
Expand Up @@ -2028,6 +2028,10 @@ loop: for (;;) {
function comma() {
if (token.line !== nexttoken.line) {
if (!option.laxcomma) {
if (comma.first) {
warning("Comma warnings can be turned off with 'laxcomma'");
comma.first = false;
}
warning("Bad line breaking before '{a}'.", token, nexttoken.id);
}
} else if (!token.comment && token.character !== nexttoken.from && option.white) {
Expand All @@ -2038,6 +2042,8 @@ loop: for (;;) {
nonadjacent(token, nexttoken);
}

comma.first = true;


// Functional constructors for making the symbols that will be inherited by
// tokens.
Expand Down

0 comments on commit 936f6fa

Please sign in to comment.