StackOverflow - javascript, gulp, eslint, airbnb-js-styleguide, eslint-config-airbnb
How do I view linting errors when i run 'gulp'?
I'm trying to install the Airbnb JavaScript style guide into my environment. I'm using gulp to show linting errors as I save my .js files but it does not show it. If I do 'eslint main.js' it shows me the errors. Is there any way I can show it through gulp when I execute 'gulp'? Here are my config files: var lint = require('gulp-eslint'); //Lint JS files, including JSX var config = { port: 9005, devBaseUrl: 'http://localhost', paths: { html: './src/*.html', js: './src/**/.js', css: [ 'node_modules/bootstrap/dist/css/bootstrap.min.css', 'node_modules/bootstrap/dist/css/bootstrap-theme.min.css' ], dist: './dist', mainJs: './src/main.js' } }; ... gulp.task('lint', function () { return gulp.src(config.paths.js) .pipe(lint()) .pipe(lint.format()) .pipe(lint.failAfterError()); }); gulp.task('watch', function () { gulp.watch(config.paths.html, ['html']); gulp.watch(config.paths.js, ['js', 'lint']); gulp.watch(config.paths.css, ['css']); }); gulp.task('default', ['html', 'js', 'css', 'lint', 'open', 'watch']); my main.js file: test = 1; var App = console.log('Testing Browserify'); module.exports = App; and here is what I see when I run 'gulp' and also when I run 'eslint main.js'. Errors should show on the terminal to the right, but it does not show any linting errors.
Was this helpful?
Related Articles
Have a different question?
Can't find the answer you're looking for? Submit your own question to our community.
🛎️ Get Weekly OTA Fixes
New answers, vendor issues, and updates — straight to your inbox.