JSLint: control comments (selective ignore)

AnC picture AnC · Mar 1, 2009 · Viewed 51.3k times · Source

Does JSLint have anything like JavaScript Lint's control comments (e.g. /*jsl:fallthru*/) to make it ignore certain passages?

Answer

napoleonss picture napoleonss · Nov 1, 2012

Put

/*ignore jslint start*/

before and

/*ignore jslint end*/ 

after the code to be ignored. Ex:

function ignore(){
    /*ignore jslint start*/
    var x; var y;
    /*ignore jslint end*/
}

Or export JsLint settings, define your IgnoreErrorStart/ IgnoreErrorEnd symbols and import.


Edit
Some folks may confuse this answer with JSHint. In that case, use these:

/*jshint ignore:start*/
  <!-- code in here -->
/*jshint ignore:end*/

Taken from https://stackoverflow.com/a/26012357/313501