首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gulp无法解析.hintrc文件

Gulp无法解析.hintrc文件
EN

Stack Overflow用户
提问于 2015-07-26 12:48:23
回答 1查看 1.2K关注 0票数 0

当运行此Gulp任务时

代码语言:javascript
复制
var gulp = require('gulp'),
    util = require('gulp-util'),    // For logging
    print = require('gulp-print'),  // For logging
    jshint = require('gulp-jshint');

gulp.task('analyse', function () {
    log('Analyzing source with JSHint')
    gulp.src(paths.jsContent)
        .pipe(print())
        .pipe(jshint())
        .pipe(jshint.reporter('jshint-stylish', { verbose: true }))
        .pipe(jshint.reporter('fail'));
});

我得到了这个输出:

14:43:26开始“分析”. 14:43:26用JSHint分析源 14:43:26在32 ms后完成“分析” 吞咽Scripts\main.js 错误:无法解析配置文件: C:\MyProject\src\MyProject.jshintrc 错误:SyntaxError:意外令牌

我使用的Gulp文件来自https://raw.githubusercontent.com/johnpapa/pluralsight-gulp/master/.jshintrc,如下所示:

代码语言:javascript
复制
{
    "bitwise": true,
    "camelcase": true,
    "curly": true,
    "eqeqeq": true,
    "es3": false,
    "forin": true,
    "freeze": true,
    "immed": true,
    "indent": 4,
    "latedef": "nofunc",
    "newcap": true,
    "noarg": true,
    "noempty": true,
    "nonbsp": true,
    "nonew": true,
    "plusplus": false,
    "quotmark": "single",
    "undef": true,
    "unused": false,
    "strict": false,
    "maxparams": 10,
    "maxdepth": 5,
    "maxstatements": 40,
    "maxcomplexity": 8,
    "maxlen": 120,

    "asi": false,
    "boss": false,
    "debug": false,
    "eqnull": true,
    "esnext": false,
    "evil": false,
    "expr": false,
    "funcscope": false,
    "globalstrict": false,
    "iterator": false,
    "lastsemic": false,
    "laxbreak": false,
    "laxcomma": false,
    "loopfunc": true,
    "maxerr": 50,
    "moz": false,
    "multistr": false,
    "notypeof": false,
    "proto": false,
    "scripturl": false,
    "shadow": false,
    "sub": true,
    "supernew": false,
    "validthis": false,
    "noyield": false,

    "browser": true,
    "node": true,

    "globals": {
        "angular": false
    }
}

这个问题能解决吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-09-24 15:03:58

只要用约翰回购的原始文件替换你的.jshintrc文件,你就会没事的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31637128

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档