You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
file.csslint.opt= {}; // The options you passed to CSSLint
67
67
```
68
68
69
-
## Using reporters
69
+
## Using formatters
70
70
71
-
Several reporters come built-in to css-lint. To use one of these reporters, pass the name to `csslint.reporter`.
71
+
Several formatters come built-in to CSSLint. To use one of these formatters, pass the name to `csslint.formatter`.
72
72
73
-
For a list of all reporters supported by `csslint`, see the [csslint wiki](https://github.com/CSSLint/csslint/wiki/Command-line-interface#--format).
73
+
For a list of all formatters supported by `csslint`, see the [csslint wiki](https://github.com/CSSLint/csslint/wiki/Command-line-interface#--format).
74
74
75
75
```js
76
76
gulp.task('lint', function() {
77
77
gulp.src('lib/*.css')
78
78
.pipe(csslint())
79
-
.pipe(csslint.reporter('junit-xml'));
79
+
.pipe(csslint.formatter('junit-xml'));
80
80
```
81
81
82
-
### Custom reporters
82
+
### Custom formatters
83
83
84
-
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.
84
+
Custom formatter functions can be passed as `csslint.formatter(formatterFunc)`. The formatter function will be called for each linted file and passed the file object as described above.
85
85
86
86
```js
87
87
var csslint =require('gulp-csslint');
88
88
var gutil =require('gulp-util');
89
89
90
-
varcustomReporter=function(file) {
90
+
varcustomFormatter=function(file) {
91
91
gutil.log(gutil.colors.cyan(file.csslint.errorCount)+' errors in '+gutil.colors.magenta(file.path));
92
92
93
93
file.csslint.results.forEach(function(result) {
@@ -98,18 +98,18 @@ var customReporter = function(file) {
98
98
gulp.task('lint', function() {
99
99
gulp.src('lib/*.css')
100
100
.pipe(csslint())
101
-
.pipe(csslint.reporter(customReporter));
101
+
.pipe(csslint.formatter(customFormatter));
102
102
});
103
103
```
104
104
105
-
### Reporter options
106
-
You can also pass options to the built-in formatter, by passing a second option to `reporter`.
105
+
### Formatter options
106
+
You can also pass options to the built-in formatter, by passing a second option to `formatter`.
107
107
108
108
```js
109
109
gulp.task('lint', function() {
110
110
gulp.src('lib/*.css')
111
111
.pipe(csslint())
112
-
.pipe(csslint.reporter('junit-xml', options));
112
+
.pipe(csslint.formatter('junit-xml', options));
113
113
});
114
114
```
115
115
@@ -122,19 +122,19 @@ Default is using `process.stdout.write`, but you can use e.g. `console.log`, or
0 commit comments