开发者

Running jshint with rhino

开发者 https://www.devze.com 2023-03-12 13:55 出处:网络
I\'m moving from checking files with jslint to jshint but the command line statement doesn\'t seem to work.

I'm moving from checking files with jslint to jshint but the command line statement doesn't seem to work.

For jslint I used the command rhino /home/mrtest/Desktop/jslint.js browser.js which worked. I tried the same thing with rhino /home/mrtest/Desktop/jshint.js browser.j开发者_Go百科s which didn't do anything.

What am I doing wrong?

Thanks.


You need to use the rhino.js file in the env directory of the full codebase: https://github.com/jshint/jshint/

e.g. rhino /home/mrtest/Desktop/jshint/env/rhino.js browser.js


Installing JsHint on Ubuntu 10.04

Assumes rhino is already installed.

  1. Download latest jshint master (tar.gz) from https://github.com/jshint/jshint/archives/master
  2. Untar into ~/bin/
  3. cd ~/bin/jshint-jshint-09e24d8
  4. make rhino

Can now use:

~/bin/jshint-jshint-09e24d8/build/jshint-rhino.js MyJsFile.js

or more conveniently:

alias jshint='~/bin/jshint-jshint-09e24d8/build/jshint-rhino.js'

$ jshint MyJsFile.js

The same will work on most Linux flavours.

0

精彩评论

暂无评论...
验证码 换一张
取 消