views:

260

answers:

0

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:

  1. 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).

  2. 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?