Custom settings with jshint-rhino.js

心不动则不痛 提交于 2019-12-12 19:02:08

问题


I've been using jshint with node but just recently had to switch over to using it with Rhino.

I used to be able to do:

jshint --config=jsHintConfig.json fileToLint.js

Now, I've tried replacing that call with:

rhino jshint-rhino.js --config=jsHintConfig.json fileToLint.js

But it doesn't seem to work. I only get the following printed to the console:

Usage: jshint.js file.js

Does jshint-rhino not accept a json configuration file?

Update:

http://anton.kovalyov.net/2011/03/01/jshint-edition-update/ - Says: "Added support for providing options to JSHint as command line arguments when used with our Rhino wrapper" but doesn't say how.

https://github.com/jshint/jshint/issues/27 - Something about specifying options on the cli, but also doesn't say how.


回答1:


This worked:

rhino jshint-rhino.js file1.js file2.js opt1=true,opt2=true,opt3=false global1,global2,global3

No need to put a comma between file names and it is important to not have spaces before or after the commas for the options and globals.



来源:https://stackoverflow.com/questions/12588643/custom-settings-with-jshint-rhino-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!