javascript - Detect and flag unused JS variables -


i'm using jshint , jscs (javascript code style checker) none of them can detect kind of unused variables:

describe('xx', function () {    var xxunused;   beforeeach(inject(function ($injector) {     xxunused = $injector.get('xxunused');   }));    // xxunused (as name says) not used in other way in block.  }); 

someone knows tool can flag automatically these variables?

there analytics tools called esprima. please take @ following links:

http://tobyho.com/2013/12/02/fun-with-esprima/

https://gist.github.com/benvie/4657032

http://ariya.ofilabs.com/2012/11/polluting-and-unused-javascript-variables.html

you should familiar nodejs. easier use esprima in nodejs.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -