jscs-dev/gulp-jscs — pull request #39 by butterflyhug (2014-10-17 01:39:36+00:00)
Title: Implement configurable reporters

Much of this code is based on the configurable reporters in @spenceralger's gulp-jshint.

This implementation is somewhat consistent with the proposal in #21:

- Linting and reporting are handled as separate processes -- `gulpjscs()` lints the files and adds metadata to each entry in the vinyl stream, and `gulpjscs.reporter()` outputs a report based on the earlier linting
- Custom reporters are supported, either as module names or import paths
- This package implements a `fail` reporter that raises a PluginError if any lint checks failed

But it also differs from #21 in a few important respects:

- `gulpjscs.reporter()` lets existing reporter implementations write directly to `console.log` -- it does not generate a vinyl file object, but rather yields the original collection of vinyl files
- Other reporters do not fail when errors occur -- since this implementation passes through the original file collection, you can just pipe to the fail reporter after your primary reporter if you want to break the stream

Note that this is a backward incompatible change, since users will need to add a reporter to their gulp streams to get the same results as in previous versions.