I'm currently using JSHint and JSCS (javascript code style checker) but none of them can detect this kind of unused variables:
describe('XX', function () {
var XXunused;
beforeEach(inject(function ($injector) {
XXunused = $injector.get('XXunused');
}));
// XXunused is (as the name says) not used in any other way in this block.
});
Someone knows any tool that can flag automatically these variables?