JSLint (CLI): options?

2020-02-09 03:31发布

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?

5条回答
▲ chillily
2楼-- · 2020-02-09 03:39

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.

查看更多
The star\"
3楼-- · 2020-02-09 03:42

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.

查看更多
劳资没心,怎么记你
4楼-- · 2020-02-09 03:47

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?

查看更多
男人必须洒脱
5楼-- · 2020-02-09 03:54

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

查看更多
冷血范
6楼-- · 2020-02-09 04:00

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.

查看更多
登录 后发表回答