I'm using eslint with Sublime Text 3 and I am writing gulpfile.js
.
(我将eslint与Sublime Text 3结合使用,并且正在编写gulpfile.js
。)
/*eslint-env node*/
var gulp = require('gulp');
gulp.task('default', function(){
console.log('default task');
});
But eslint keeps showing error : "Error: Unexpected console statement. (no-console)"
(但是eslint不断显示错误:“错误:意外的控制台语句。(无控制台)”)
I found official document here , but I still don't know how to disable it.
(我在这里找到了官方文档 ,但是我仍然不知道如何禁用它。)
/*eslint-env node*/
var gulp = require('gulp');
/*eslint no-console: 2*/
gulp.task('default', function(){
console.log('default task');
});
doesn't work, either.
(也不起作用。)
My Sublime Text 3 plugins: SublimeLinter and SublimeLinter-contrib-eslint.
(我的Sublime Text 3插件:SublimeLinter和SublimeLinter-contrib-eslint。)
Here's my .eslintrc.js
file:
(这是我的.eslintrc.js
文件:)
module.exports = {
"rules": {
"no-console":0,
"indent": [
2,
"tab"
],
"quotes": [
2,
"single"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
]
},
"env": {
"browser": true,
"node": true
},
"extends": "eslint:recommended"
};
ask by Jean Y.C. Yang translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…