2015-09-23 36 views
2

任何错误我已经定义了一大口的任务是这样一饮而尽,eslint没有显示在控制台上

var lint = require('gulp-eslint'); 
gulp.task('lint', function() { 
    return gulp.src(config.paths.js) 
     .pipe(lint({config: 'eslint.config.json'})) 
     .pipe(lint.format()); 
}); 

像这样

$ = jQuery = require('jquery'); 

var App = console.log('hello from browserfiy'); 

module.exports = App; 

一个js文件,当我加入var test = 15; var test = 20;编辑我的js文件和保存,线头不显示在控制台上的错误信息,虽然从控制台我可以看到棉绒被踢出像

Starting 'lint'... 
Finished 'lint' 29ms 

eslint.config.json

{ 
    "ecmaFeatures": { 
    "jsx": true 
    }, 
    "env": { 
    "browser": true, 
    "node": true, 
    "jquery": true 
    }, 
    "rules": { 
    "quotes": 0, 
    "no-trailing-spaces": 0, 
    "eol-last": 0, 
    "no-unused-vars": 0, 
    "no-underscore-dangle": 0, 
    "no-alert": 0, 
    "no-lone-blocks": 0 
    }, 
    "globals": { 
    jQuery: true, 
    $: true 
    } 
} 
+1

我可以”没有看到你的设置有什么问题......你有没有偶然地禁用'no-redeclare'规则? – kombucha

+0

也许发布作为答案,并将其标记为已解决:) 干杯 – kombucha

+0

你也做过复数游戏课程? ;-) 我遇到过同样的问题。感谢分享! – Svenisok

回答

1

正如在评论中看到的那样,你可以重新声明一个变量时添加到您的eslint配置,以得到一个错误:

"no-redeclare": 1 

Rule documentation