Using a config file for JSHint with Rhino

不想你离开。 提交于 2019-12-10 18:25:22

问题


I'm attempting to run jsHint from the command line using Rhino. I want to make the check an automatic part of my teams checkin process.

I have the basic configuration working using the command:

java -jar .rhino.jar ./jshint.js ./samplefile.js

That outputs the standard jsHint messages for my (intentionally error-ridden) sample file. And adding config comments to the top of the sample file works correctly. However I would like to add a project level config file to specify the options I want for each file without adding comments to each individual file.

I found instructions to do so for the node.js command line based tool, but have been unable to replicate this with the Rhino wrapper.
I attempted various variations on:

java -jar .rhino.jar ./jshint.js ./samplefile.js --configure=./config.js

but that didn't seem to work for the rhino version.
Any pointers?

UPDATE:

Found this question (Custom Settings with jshint-rhino) from a few weeks ago.

This pointed out that the following format works:

java -jar .rhino.jar ./jshint.js ./samplefile.js option1=true option2=false global global

This worked for me, however I would like to specify a large amount of options and have it be easily configurable, so I would very much prefer to use a json config file as in the node.js distribution.

Could somebody confirm that this is possible/not possible?


回答1:


Unfortunately, our Rhino wrapper is pretty basic and doesn't support config files. It would be nice to have that—perhaps you would like to create a ticket?



来源:https://stackoverflow.com/questions/12977878/using-a-config-file-for-jshint-with-rhino

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