【发布时间】:2015-09-29 15:58:10
【问题描述】:
通过调用
grunt jshint:path_to_file
我想覆盖默认的 JSHint 配置
grunt.initConfig({
jshint: {
options: {
curly: true,
eqeqeq: true,
eqnull: true,
browser: true,
globals: {
jQuery: true
}
},
all: ['Gruntfile.js', 'Scripts/src/**/*.js']
}
});
并且只包含那个特定的文件。 “grunt jshint path_to_file”也可以,但我不想使用
grunt jshint --file=filePath
grunt.option 函数,除非它可以满足我的需要。
这是否可以通过某种方式实现?
【问题讨论】:
-
为什么要使用 grunt 而不是只运行
jshint filePath? -
我们的项目要求只依赖 grunt 进行构建、测试等,以便将所有内容集中在一个地方。
标签: command-line parameters gruntjs overriding jshint