我有一个简单的gulpfile.js,当我尝试运行gulp时,我会得到一个意外的标记错误。在.pipe,为什么?
1 var gulp = require('gulp');
2 var jshint = require('gulp-jshint');
3
4 var jsFiles = ['*.js', 'src/**/*.js'];
5
6 gulp.task('style', function(){
7 gulp.src(jsFiles)
8 .pipe(jshint())
9 .pipe(jshint.reporter('jshint-stylish',{
10 verbose: true
11 }));
12 })我的Package.json:
1 {
2 "name": "app",
3 "version": "1.0.0",
4 "description": "",
5 "main": "app.js",
6 "scripts": {
7 "test": "echo \"Error: no test specified\" && exit 1",
8 "start": "node app.js"
9 },
10 "author": "",
11 "license": "ISC",
12 "dependencies": {
13 "express": "^4.13.3"
14 },
15 "devDependencies": {
16 "gulp": "^3.9.0",
17 "gulp-jscs": "^3.0.2",
18 "gulp-jshint": "^2.0.0",
19 "jshint-stylish": "^2.1.0"
20 }
21 }gulp和jshint时尚都已经安装好了。
发布于 2016-01-22 04:37:09
您需要确保安装了jshint和jshint-stylish,并在项目的package.json文件中声明为依赖项。
发布于 2016-01-22 04:47:29
您需要在您的吞咽文件中要求jshint风格,然后使用它。
https://stackoverflow.com/questions/34938660
复制相似问题