Question

I'm running JSLint's Rhino version from the Ubuntu command line like so:

$ rhino jslint.js myScript.js

While the web interface offers various options, I couldn't figure out how to invoke those via the command line. Am I overlooking anything in the documentation?

Was it helpful?

Solution

Yes! You did miss it. You can specify the options for jslint at the top of your .js file. See the doc page and read the options section for an example.

OTHER TIPS

I was inspired by the discussion above, and extended my JSLint wrapper script accordingly. It's fairly primitive, but seems to do the job.

My jslint4java project includes a command line tool that allows you to add in flags like --undef. This may be more useful than running it by hand.

There is a perl+js wrapper for jslint that Cory Bennet put together (based on Ian Bicking's prior art). It's got command-line options, etc. He even details some Emacs integration via a compile-mode hook.

I had some trouble, and put some notes up on getting it to work in Cygwin and Emacs32.

There are some other options in a similar question: Is there an offline version of jslint for windows?

I came up with a command line jslint solution based on jQuery's jslint-check.js script, which is executed within Rhino via their Makefile.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top