Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off JSLint indentation warnings?

I find that JSLint produces lots of warnings of the form:

Expected 'foo' to have an indentation at X instead at Y.

The JSLint options documentation describes an indent option that recognizes a numerical value representing the amount of space for each level of indentation. This option allows me to say things like use 2 spaces per level of indentation. I just write something like this at the top of my JavaScript file:

/*jslint indent: 2 */

OK, great. Now JSLint knows how much to indent for each level of indentation, but JSLint seems to be hardcoded to decide what level of indentation each line should have.

Suppose I want to indent my code differently than the way JSLint prescribes. Can I do this with some JSLint option? If not, can I at least turn off the indentation warnings? I tried:

/*jslint indent: false */

but that did not cause indentation warnings to be elided; it caused a JSLint error.

like image 832
Greg Mattes Avatar asked Aug 12 '09 10:08

Greg Mattes


1 Answers

What a difference that morning coffee makes:

/*jslint white: true */
like image 194
Greg Mattes Avatar answered Oct 19 '22 03:10

Greg Mattes