当我从命令行运行“gulp style”时,Gulp 运行,随后 gulp-jscs 运行,但后者似乎无法检测到 jscs 配置文件 (.jscsrc) 中定义的规则。但是,如果我从命令行运行 jscs,那么 jscs 确实会检测到配置文件的规则。知道这笔交易可能是什么吗?
这是我的 gulp 文件:
(function() {
"use strict";
var gulp = require("gulp");
var jshint = require("gulp-jshint");
var jscs = require("gulp-jscs");
var jsFiles = ["*.js", "src/**/*.js"];
gulp.task("style", function () {
console.log("Running the style task.");
return gulp.src(jsFiles)
.pipe(jshint())
.pipe(jshint.reporter("jshint-stylish", {
verbose: true
}))
.pipe(jscs({configPath: "./.jscsrc"}));
});
})();