1
1
# gulp-jscs [ ![ Build Status] ( https://travis-ci.org/jscs-dev/gulp-jscs.svg?branch=master )] ( https://travis-ci.org/jscs-dev/gulp-jscs )
2
2
3
- > Check JavaScript code style with [ ` jscs ` ] ( http://jscs.info )
3
+ > Check JavaScript code style with [ JSCS ] ( http://jscs.info )
4
4
5
5
![ ] ( screenshot.png )
6
6
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 ) .*
8
8
9
9
10
10
## Install
@@ -19,26 +19,25 @@ $ npm install --save-dev gulp-jscs
19
19
### Reporting
20
20
21
21
``` js
22
- var gulp = require (' gulp' );
23
- var jscs = require (' gulp-jscs' );
22
+ const gulp = require (' gulp' );
23
+ const jscs = require (' gulp-jscs' );
24
24
25
- gulp .task (' default' , function () {
25
+ gulp .task (' default' , () => {
26
26
return gulp .src (' src/app.js' )
27
- .pipe (jscs ());
27
+ .pipe (jscs ())
28
+ .pipe (jscs .reporter ());
28
29
});
29
30
```
30
31
31
- ### Fixing & reporting
32
+ ### Fixing
32
33
33
34
``` js
34
- var gulp = require (' gulp' );
35
- var jscs = require (' gulp-jscs' );
35
+ const gulp = require (' gulp' );
36
+ const jscs = require (' gulp-jscs' );
36
37
37
- gulp .task (' default' , function () {
38
+ gulp .task (' default' , () => {
38
39
return gulp .src (' src/app.js' )
39
- .pipe (jscs ({
40
- fix: true
41
- }))
40
+ .pipe (jscs ({fix: true }))
42
41
.pipe (gulp .dest (' src' ));
43
42
});
44
43
```
@@ -69,14 +68,21 @@ A `jscs` object will be attached to the file object which can be used for custom
69
68
70
69
#### options
71
70
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 ) .
75
72
76
73
Alternatively you can set the ` configPath ` * (default: ` '.jscsrc' ` )* option to the path of a [ .jscsrc] ( http://jscs.info/rules.html ) file.
77
74
78
75
Set ` 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.
79
76
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
+
80
86
81
87
## License
82
88
0 commit comments