【发布时间】:2014-11-14 19:53:10
【问题描述】:
我目前正在尝试将 grunt 项目迁移到 gulp 项目。实际上,在 gruntfile 中我有(对于 jshint 任务)是这样的:
jshint: {
options: {
trailing:true,
evil:false,
indent:4,
undef:true,
unused:true,
node:false,
browser:false,
loopfunc:true,
devel:false
},
default: {
options: {
browser:true,
globals: {
define:true
}
},
src: [basePath + "js/**/*.js"]
}
}
所以,当我在终端中写“grunt jshint”时,它似乎工作正常。但是,在 gulpfile 中我写了这个:
gulp.task("jshint", function() {
return gulp.src( basePath + "js/**/*.js" )
.pipe( jshint( { "trailing": true,..., "globals": true } ) )
.pipe( jshint.reporter("default") );
});
但是当我在终端中写“gulp jshint”时,它崩溃了。
我的问题是:有没有办法使用 gulp-jshint 节点包发送不带 .jshintrc 文件的 jshint 参数? (我已经阅读了 npm 站点中的文档,但我不理解“查找”选项)
【问题讨论】:
标签: javascript node.js gulp jshint