A Gulp plugin that generates a checkstyle report from stylelint results.
Use gulp-stylelint with gulp-stylelint-checkstyle-reporter instead.
npm install gulp-stylelint-checkstyle --save-dev
With gulp-stylelint-checkstyle, it's easy to start generate a CSS lint report for Jenkins checkstyle plugin.
If you already have a .stylelintrc file in your project directory:
gulp.task('lint-css', function lintCssTask() {
return gulp
.src('src/**/*.css')
.pipe(gulpStylelintCheckstyle({
output: 'reports/lint/lint-css.xml'
}));
});
Below is an example with all available options provided:
gulp.task('lint-css', function lintCssTask() {
return gulp
.src('src/**/*.css')
.pipe(gulpStylelintCheckstyle({
stylelint: {
extends: 'stylelint-config-suitcss'
},
output: 'reports/lint/lint-css.xml',
reportToConsole: true,
failAfterAllErrors: true
}));
});
See stylelint configuration options.
Relative or absolute path to the report output file, e.g. "reports/lint/lint-css.xml"
Setting this option to true
will report all issues to the console as well (the checkstyle report file will still be written).
Setting this option to true
will wait for all reporters to finish and then terminate the process with an error code 1 if linting issues (errors or warnings) have been found.