captainbrosset/cleanjs — Issue #26: Unused error triggered too often
Author: juliandescottes
Created: 2012-02-05 00:14:53+00:00
State: open

Considering the following snippet :

var myMethod = function () {
var someBoolean = false;
if (!someBoolean) {
//do stuff
}
}

Clean JS will complain about someBoolean being unused :
line 2 | unused error : Variable someBoolean in method myMethod is declared but never used

With the slightly modified snippet :
var myMethod = function () {
var someBoolean = false;
if (someBoolean == false) {
//do stuff
}
}

Clean JS doesn't complain.