Skip to content

Commit

Permalink
[[FIX]] Ignore directive should ignore max line length for comments
Browse files Browse the repository at this point in the history
Fixes #1575
  • Loading branch information
lukeapage authored and jugglinmike committed Aug 8, 2015
1 parent 728c84b commit f2f871a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lex.js
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,8 @@ Lexer.prototype = {
// If there is a limit on line length, warn when lines get too
// long.

if (state.option.maxlen && state.option.maxlen < this.input.length) {
if (!this.ignoringLinterErrors && state.option.maxlen &&
state.option.maxlen < this.input.length) {
var inComment = this.inComment ||
startsWith.call(inputTrimmed, "//") ||
startsWith.call(inputTrimmed, "/*");
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/fixtures/maxlen.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ a = 23;
/*
http://jshint.com/docs/
*/
/*jshint ignore:start*/
// third-party code
// this very very very very very very very very very very very very very long comment line will produce warning "Line is too long." unless W101 is explicitly disabled
/*jshint ignore:end*/

0 comments on commit f2f871a

Please sign in to comment.