简体   繁体   English

使用带有Rhino的JSHint配置文件

[英]Using a config file for JSHint with Rhino

I'm attempting to run jsHint from the command line using Rhino. 我正在尝试使用Rhino从命令行运行jsHint。 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. 这为我的(故意错误的)示例文件输出标准的jsHint消息。 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. 我找到了基于node.js命令行的工具的说明,但是无法使用Rhino包装器复制它。
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. 几个星期前发现了这个问题(jshint-rhino的自定义设置)

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. 这对我有用,但是我想指定大量选项并且可以轻松配置,所以我更喜欢在node.js发行版中使用json配置文件。

Could somebody confirm that this is possible/not possible? 有人可以确认这是可能/不可能吗?

Unfortunately, our Rhino wrapper is pretty basic and doesn't support config files. 不幸的是,我们的Rhino包装器非常基本,不支持配置文件。 It would be nice to have that—perhaps you would like to create a ticket? 拥有它会很高兴 - 也许你想创建一张票?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM