I recently noticed and fixed a pretty bad JS bug in our software, affecting all IE versions, that was caused by a simple mistake in a .js file:
const foo = "..."
Now, IE doesn't support const; it's a syntax error. var
should be used instead. (The offending keyword was actually inserted unwittingly by IntelliJ IDEA's "introduce variable... -> introduce constant" refactoring.)
Our automated Selenium tests are run with Firefox on Linux, and getting them running on IE would probably be too much hassle right now.
Anyway, my question is, is there any static JS code analysis tool that
- would have caught the
const
bug (and similar common problems), and - can be easily triggered from a CI tool (Jenkins) against certain .js files in a codebase?
I am aware of JSHint, JSLint and Google Closure Tools, but I don't know if any of them meets my criteria above.