11# gulp-jscs [ ![ Build Status] ( https://travis-ci.org/jscs-dev/gulp-jscs.svg?branch=master )] ( https://travis-ci.org/jscs-dev/gulp-jscs )
22
3- > Check JavaScript code style with [ ` jscs ` ] ( http://jscs.info )
3+ > Check JavaScript code style with [ JSCS ] ( http://jscs.info )
44
55![ ] ( screenshot.png )
66
7- * Issues with the output should be reported on the ` jscs ` [ issue tracker] ( https://github.com/jscs-dev/node-jscs/issues ) .*
7+ * Issues with the output should be reported on the JSCS [ issue tracker] ( https://github.com/jscs-dev/node-jscs/issues ) .*
88
99
1010## Install
@@ -19,26 +19,25 @@ $ npm install --save-dev gulp-jscs
1919### Reporting
2020
2121``` js
22- var gulp = require (' gulp' );
23- var jscs = require (' gulp-jscs' );
22+ const gulp = require (' gulp' );
23+ const jscs = require (' gulp-jscs' );
2424
25- gulp .task (' default' , function () {
25+ gulp .task (' default' , () => {
2626 return gulp .src (' src/app.js' )
27- .pipe (jscs ());
27+ .pipe (jscs ())
28+ .pipe (jscs .reporter ());
2829});
2930```
3031
31- ### Fixing & reporting
32+ ### Fixing
3233
3334``` js
34- var gulp = require (' gulp' );
35- var jscs = require (' gulp-jscs' );
35+ const gulp = require (' gulp' );
36+ const jscs = require (' gulp-jscs' );
3637
37- gulp .task (' default' , function () {
38+ gulp .task (' default' , () => {
3839 return gulp .src (' src/app.js' )
39- .pipe (jscs ({
40- fix: true
41- }))
40+ .pipe (jscs ({fix: true }))
4241 .pipe (gulp .dest (' src' ));
4342});
4443```
@@ -69,14 +68,21 @@ A `jscs` object will be attached to the file object which can be used for custom
6968
7069#### options
7170
72- Type: ` object `
73-
74- See the ` jscs ` [ options] ( http://jscs.info/overview.html#options ) .
71+ See the JSCS [ options] ( http://jscs.info/overview.html#options ) .
7572
7673Alternatively you can set the ` configPath ` * (default: ` '.jscsrc' ` )* option to the path of a [ .jscsrc] ( http://jscs.info/rules.html ) file.
7774
7875Set ` fix: true ` if you want jscs to attempt to auto-fix your files. Be sure to pipe to ` gulp.dest ` if you use this option.
7976
77+ ### jscs.reporter([ reporter] )
78+
79+ See the JSCS [ reporter docs] ( http://jscs.info/overview#-reporter-r ) for supported input.
80+
81+ This plugin also ships with some custom reporters:
82+
83+ - ` fail ` - Emits an error at the end of the stream if there are lint errors.
84+ - ` failImmediately ` - Emits an error immediately if there are lint errors.
85+
8086
8187## License
8288
0 commit comments