How to use the format function from gulp-eslint
Find comprehensive JavaScript gulp-eslint.format code examples handpicked from public code repositorys.
GitHub: londomloto/interact.js
3 4 5 6 7 8 9 10 11 12
gulp.task('lint', module.exports = function () { return gulp.src(['src/**/*.js']) // eslint() attaches the lint output to the eslint property // of the file object so it can be used by other modules. .pipe(eslint()) // eslint.format() outputs the lint results to the console. // Alternatively use eslint.formatEach() (see Docs). .pipe(eslint.format()) // To have the process exit with an error code (1) on // lint error, return the stream and pipe to failOnError last.
763
0
2
211 212 213 214 215 216 217 218 219 220
gulp.src(['**/*.js','!node_modules/**']) .pipe(eslint()) .pipe(eslint.failAfterError()); ``` ### eslint.format(formatter, output) Format all linted files once. This should be used in the stream after piping through `eslint`; otherwise, this will find no ESLint results to format. The `formatter` argument may be a `String`, `Function`, or `undefined`. As a `String`, a formatter module by that name or path will be resolved as a module, relative to `process.cwd()`, or as one of the [ESLint-provided formatters](https://github.com/eslint/eslint/tree/master/lib/formatters). If `undefined`, the ESLint “stylish” formatter will be resolved. A `Function` will be called with an `Array` of file linting results to format.
122
562
10
+ 7 other calls in file
GitHub: sophilabs/gilp
22 23 24 25 26 27 28 29 30 31
return combiner( 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(),
3
14
10
+ 3 other calls in file
GitHub: maliMirkec/code-line-daily
48 49 50 51 52 53 54 55 56 57
// Will process JS files 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}`);
3
17
3
3 4 5 6 7 8 9
module.exports = function( src ) { return gulp.src( src ) .pipe(plumber()) .pipe(eslint()) // eslint() attaches the lint output to the "eslint" property of the file object so it can be used by other modules. .pipe(eslint.format()) // eslint.format() outputs the lint results to the console. Alternatively use eslint.formatEach() (see Docs). }
0
8
5
gulp-eslint.format is the most popular function in gulp-eslint (49 examples)