Consider this simple javascript code – http://jsfiddle.net/mark69_fnd/c2DRP/
Validating the code with JSLint triggers the jslint “Strict violation” error on the usage of this inside the inner function. However, that function is invoked with the correct non global context.
So, I wonder how do I suppress this JSLint error for that particular function?
Thanks.
JSLint does not support this, you’ll have to just ignore it. The community fork called JSHint has an option called
validthiswhich can suppress the warnings in cases like yours: