I am trying to keep the jslint exception as close to the error as possible so as not to hide the errors by mistake. The unused parameter in example x in function f2 , and I would like to exclude this event only.
The first example, with the exception of the surrounding function, works, but will hide other errors, if any:
function test1() { var f1 = function (x) { alert(x); }, f2 = function (x) {}; f1(0); f2(0); }
The surrounding var statement also works, but hides errors in f1 :
function test2() { var f1 = function (x) { alert(x); }, f2 = function (x) {}; f1(0); f2(0); }
This generates an error: "The expected identifier and instead saw" / * jslint (reserved word). "
function test3() { var f1 = function (x) { alert(x); }, f2 = function (x) {}; f1(0); f2(0); }
The question is, where in the source code can you have jslint directives?
source share