Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/*jshint ignore:start*/ does not ignore W101 "Line is too long." #1575

Closed
victor-homyakov opened this issue Mar 19, 2014 · 9 comments
Closed

Comments

@victor-homyakov
Copy link
Contributor

Region of code marked with /*jshint ignore:start*/ ... /*jshint ignore:end*/ in JSHint 2.4.4 still may produce warning "Line is too long." for commented line

Code to completely ignore warnings in some region of code looks like

/*jshint ignore:start,-W101*/
// 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,+W101*/
@valueof
Copy link
Member

valueof commented Mar 27, 2014

This was fixed with bf886b8.

@valueof valueof closed this as completed Mar 27, 2014
@spirosdi
Copy link

It seems that issue still appears when using grunt-contrib-jshint v0.11.0 which uses jshint v ~2.6.0

@lukeapage lukeapage reopened this Jun 25, 2015
@lukeapage
Copy link
Member

you are right. test case:

/* jshint maxlen: 50 */
/*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*/

@lukeapage
Copy link
Member

may be also fixed by #2477

@lukeapage
Copy link
Member

not fixed by #2512 or earlier patches

@simonv3
Copy link

simonv3 commented Jun 15, 2016

This is still happening for me in 2.9.2

/* jshint ignore:start */
// Look at https://github.com/jasmine/jasmine/blob/f6da0846423a08959b5602a630d419e3059283aa/src/core/matchers/toHaveBeenCalledWith.js
/* jshint ignore:end */

We use a .jshint.rc file in our case.

But using /* jshint -W101 */ before the line does work, so this isn't urgent for me.

@englishextra
Copy link

This is not fixed yet

@jugglinmike
Copy link
Member

@englishextra I cannot reproduce the erroneous warning in JSHint version 2.9.2
or 2.9.4 (the latest as of this writing). Can you please share a complete program
that demonstrates the bug? Be sure to include the necessary configuration as an
in-line directive (e.g. /* jshint maxlen: 50 */).

@englishextra
Copy link

Well the idea is to hide masonry lib from linting

https://gist.github.com/englishextra/f1cc7d27876773f206081a2fd261be01

In my case it appears not to ignore the commented code

https://gist.github.com/englishextra/f1cc7d27876773f206081a2fd261be01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants