Reputation: 65262
I'd like to run JSLint4Java as part of my build process. I have about 1000 JS files in a library, and don't really want to add a
/*globals foo, bar, baz */
header to each of them -- especially since many of them are from an external library (Dojo). If I don't add the header, though, JSLint complains about the same five globals on nearly every single file. Is there a way to tell JSLint to ignore them? Some things I've thought of so far:
Some sort of AntFileMap task that creates a virtual directory hierarchy that's an exact copy of another hierarchy, but has a filter applied to each file (in this case, prepend with a /*globals */
header).
Hack JSLint4Java to accept a set of globals
which it prepends as a comment to the beginning of every file it processes.
I've never seen anything like (1). (2) seems relatively easy, but I'd prefer to use original tools if possible. Any better suggestions?
Upvotes: 2
Views: 2447
Reputation: 5651
You can also use LintRoller - a Node.js utility for checking entire directories or projects against JSLint, JSHint and other validations.
Upvotes: 0
Reputation: 19782
From http://www.ohloh.net/p/jslint4java
News 2009-12-02. jslint4java 1.3.3 is released. Noteworthy alterations: Add support for the predef option, to allow specifying a list of predefined global variables.
Sounds like what you might be looking for. Try the --help option to get the syntax, maybe?
Upvotes: 2