Skip to content

Commit 7c85ddb

Browse files
committed
Document csslint.failReporter, closes #11
1 parent 36b6e70 commit 7c85ddb

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ file.csslint.opt = {}; // The options you passed to CSSLint
6464

6565
## Custom Reporters
6666

67-
Custom reporter functions can be passed as `cssline.reporter(reporterFunc)`. The reporter function will be called for each linted file and passed the file object as described above.
67+
Custom reporter functions can be passed as `csslint.reporter(reporterFunc)`. The reporter function will be called for each linted file and passed the file object as described above.
6868

6969
```javascript
7070
var csslint = require('gulp-csslint');
@@ -85,6 +85,22 @@ gulp.task('lint', function() {
8585
});
8686
```
8787

88+
## Fail on errors
89+
90+
Pipe the file stream to `csslint.failReporter()` to fail on errors.
91+
92+
```javascript
93+
var csslint = require('gulp-csslint');
94+
95+
gulp.task('lint', function() {
96+
gulp.files('lib/*.css')
97+
.pipe(csslint())
98+
.pipe(csslint.reoprter()) // Display errors
99+
.pipe(csslint.failReporter()); // Fail on error
100+
});
101+
```
102+
103+
88104
[travis-url]: http://travis-ci.org/lazd/gulp-csslint
89105
[travis-image]: https://secure.travis-ci.org/lazd/gulp-csslint.png?branch=master
90106
[npm-url]: https://npmjs.org/package/gulp-csslint

0 commit comments

Comments
 (0)