Answer the question
In order to leave comments, you need to log in
VSCode, Gulp and Eslint: which one is lying?
Good day everyone.
Please help me with setting up linter in Visual Studio Code and Gulp. So, we have a project that Gulp builds; there is a task for the project:
var gulp = require("gulp");
var eslint = require("gulp-eslint");
gulp.task("lint", function () {
return gulp.src("js/**")
.pipe(eslint({ fix: true }))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
{
"extends": "eslint:recommended",
"parser": "babel-eslint",
"env": { "browser": true, "jquery": true, "es6": true },
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": { "classes": true }
},
"rules": { "strict": [2, "function"] }
}
function dummy() {
console.log("dummy");
}
Use the function for of "use strict"
. However, if I do gulp lint
, then no errors are thrown. Answer the question
In order to leave comments, you need to log in
Use the function for "use strict"
This is more of a warn than an error. Therefore, nothing is output to the console. It's just that in VSCode the console shows eslint warnings, but the terminal doesn't seem to. In addition, your code will probably compile, because, unlike error, warn is not a reason to interrupt linting.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question