Error report localization for: EditorConfig ESLint JSCS JSHint CssLint PostCSS TSLint
npm install gulp-eslint
gulp.src('test/fixtures/eslint/invalid.js')
.pipe(eslint())
.pipe(reporter(options));
reporter(options)
Type: Array|string|RegExp|function
Default: /[\.\-]min\.\w+$/
Glob patterns for paths to ignore. String or array of strings.
Type: boolean
Default: false
Report error messages right in your browser.
Type: boolean|function
Default: true
Report error messages in gutil.log() or your function
Type: boolean|function
Default: true
Messages will not be sorted by severity/line/column, or your function.
Type: Array
Default: [reporter.filterByAuthor()]
Filter Error
object by your callback functions. support Async function
The default function will check the GIT author of the code that is in errors, and adjusts the error level to 'warn' if this is not related to the current author
gulp.src('test/fixtures/postcss/test.css')
.pipe(postcss())
.pipe(reporter({
filter: async function (errs, file){
await readFile(file.path);
return errs.filter(err => err.plugin === 'stylelint');
}
})
)
Type: boolean
Default: true
Make your terminal beep if an error has been reported for any file.
Type: boolean|function
Stop a task/stream if an error has been reported for any file, but wait for all of them to be processed first.
You can use a function to determine stop or not to stop.
gulp.src('test/fixtures/postcss/test.css')
.pipe(postcss())
.pipe(reporter({
fail: function(err, file) {
return err.plugin === 'stylelint' && /^src\b/.test(file.relative);
}
})
)
According to the author of GIT commit, downgraded each error to warning that is not commit by this author. If options are unset, It will lookup author info from environment or git log
Type: string
Default: ${GIT_AUTHOR_NAME}
|| git log --max-count=1 --no-merges --format=%aN
Type: string
Default: ${GIT_AUTHOR_EMAIL}
|| git log --max-count=1 --no-merges --format=%aE