#gulp-standard-bundle
Linter for gulp that use the given standard instance (or use the supported one as default) and format the code with a given standard-format instance (or use the supported one as default)
Created to support the usage of standard and standard-format with gulp (fork of gulp-standard to include the formatter)
$ npm install --save-dev gulp-standard-bundle
Using the 'default' standard version (check package dependencies)
var gulp = require('gulp')
var linter = require('gulp-standard-bundle').linter
gulp.task('lint', function () {
return gulp.src(['./app.js'])
.pipe(linter())
.pipe(linter.reporter('default', {
breakOnError: true
}))
})
Using the 'default' standard version with options
var gulp = require('gulp')
var linteropts = { globals : ['identifier'] }
var linter = require('gulp-standard-bundle').linter
gulp.task('lint', function () {
return gulp.src(['./app.js'])
.pipe(linter(undefined, linteropts))
.pipe(linter.reporter('default', {
breakOnError: true
}))
})
Using a given standard instance
var gulp = require('gulp')
var standard = require('standard')
var linter = require('gulp-standard-bundle').linter
gulp.task('lint', function () {
return gulp.src(['./app.js'])
.pipe(linter(standard))
.pipe(linter.reporter('default', {
breakOnError: true
}))
})
Using a given standard instance with options
var gulp = require('gulp')
var standard = require('standard')
var linteropts = { globals : ['identifier'] }
var linter = require('gulp-standard-bundle').linter
gulp.task('lint', function () {
return gulp.src(['./app.js'])
.pipe(linter(standard, linteropts))
.pipe(linter.reporter('default', {
breakOnError: true
}))
})
Using the 'default' standard-format version (check package dependencies)
var gulp = require('gulp')
var formatter = require('gulp-standard-bundle').formatter
gulp.task('format', function () {
return gulp.src(['./app.js'])
.pipe(formatter())
.pipe(formatter.reporter('default'))
})
Using a given standard-format instance
var gulp = require('gulp')
var standardformat = require('standard-format')
var formatter = require('gulp-standard-bundle').formatter
gulp.task('format', function () {
return gulp.src(['./app.js'])
.pipe(formatter(standardformat))
.pipe(formatter.reporter('default'))
})
You can choose a reporter when you call
stuff
.pipe(linter())
.pipe(linter.reporter('default', opts))
You can also use some other reporter instance
var reporter = require(<REPORTER NAME>);
...
.pipe(formatter())
.pipe(formatter.reporter(reporter))
Or pass the reporter name ()
...
.pipe(linter())
.pipe(linter.reporter(<REPORTER NAME>, opts))
Type: boolean
Default: false
Emit gulp error on reported error
Type: boolean
Default: false
Emit gulp error on reported warning
No options