How to use the failAfterError function from gulp-eslint
Find comprehensive JavaScript gulp-eslint.failAfterError code examples handpicked from public code repositorys.
200 201 202 203 204 205 206 207 208 209
gulp.src(['**/*.js','!node_modules/**']) .pipe(eslint()) .pipe(eslint.failOnError()); ``` ### eslint.failAfterError() Stop a task/stream if an ESLint error has been reported for any file, but wait for all of them to be processed first. ```javascript
122
562
10
+ 3 other calls in file
GitHub: maliMirkec/code-line-daily
49 50 51 52 53 54 55 56 57 58
function jsStart() { return src(helpers.trim(`${helpers.source()}/${global.config.js.src}/*.js`)) .pipe(gulpif(global.config.js.sourcemaps, sourcemaps.init())) .pipe(gulpif(global.config.js.lint, eslint(thisEslintConfig))) .pipe(gulpif(global.config.js.lint, eslint.format())) .pipe(gulpif(global.config.js.lint, eslint.failAfterError())) .pipe(gulpif(global.config.js.lint, eslint.result((result) => { console.log(`[JS] ESLint complete: ${result.filePath}`); console.log(`[JS] Messages: ${result.messages.length}`); console.warn(`[JS] Warnings: ${result.warningCount}`);
3
17
3
GitHub: sophilabs/gilp
23 24 25 26 27 28 29 30 31 32
src, print(), filenameHint({ regExp: /(^|\/)[a-z0-9.-]+\.js$/ }), eslint(), eslint.format(), eslint.failAfterError(), checkGrep(/console\.log(.(?!noqa$))+$/gm, { message: 'console.log' }), checkGrep(/debugger$(.(?!noqa$))+$/gm, { message: 'debugger' }), checkGrep.failOnError(), src.restore
3
14
10
+ 3 other calls in file
116 117 118 119 120 121 122 123 124 125 126 127
gulp.task('lint:scripts', () => { return gulp.src(allScriptFiles) .pipe(eslint()) .pipe(eslint.format()) .pipe(continueOnError ? gutil.noop() : eslint.failAfterError()) }) gulp.task('lint:styles', () => { return gulp.src(srcStyleFiles)
0
0
1
+ 4 other calls in file
gulp-eslint.format is the most popular function in gulp-eslint (49 examples)