customisable JSLint
Posted
by Don
on Stack Overflow
See other posts from Stack Overflow
or by Don
Published on 2010-06-02T07:48:53Z
Indexed on
2010/06/02
7:54 UTC
Read the original article
Hit count: 252
Hi,
I'm looking for a tool that checks JS code, which can be integrated into a Maven build. I need a tool that will check for errors such as
- use of reserved words as identifiers
trailing semi-colon, e.g.
var obj = { a: 1, b, 2, }
JSLint seems like a perfect candidate, but the problem is that it is too strict, because it also checks for various coding patterns which are (arguably) bad style, but do not actually generate errors in a browser. Examples of such issues include
Disallow ++ and --
and
Allow one var statement per function
If possible, I would like the errors to fail the build, and I would like the other rules to only print warnings (or disable them completely). Obviously, I need the ability to specify which of the available rules I consider errors and which I consider warnings.
Thanks, Don
© Stack Overflow or respective owner