Does JSLint have anything like JavaScript Lint\'s control comments (e.g. /*jsl:fallthru*/
) to make it ignore certain passages?
Put /*jsl:ignore*/
and /*jsl:end*/
around the code.
You can also: ......
ignoreThis(); // jslint ignore:line
Is there a way to suppress JSHint warning for one given line?
I'm going to say, No. JSLint does not seem to have a simple way to say, 'ignore this block of code', very much to my annoyance. Disabling the different options individually and then turning them back on like Matt seems to suggest should work, but it's not going to be elegant like JSHint's /* jshint ignore:start */
, /* jshint ignore:end */
.
The reason I was looking into this is because I'm using Brackets, which comes with JSLint as it's default linter. I have some minified 3rd party code that I copied into my .js, temporarily, and as long as it's in there JSLint is going to complain. What stinks is I often want to paste a minified chunk early on, which is also when I want the linter looking at my code to help me rule out obscure errors. Later I'll just minify and concat everything with Grunt, but not being able to disable it for a block early on is really, really, annoying.