gulp-stylelint eslint travis-ci npm

Gulp plugin for running Stylelint results through various reporters.

3 years after


NPM version Build Status Dependency Status Join the chat at

A Gulp plugin that runs stylelint results through a list of reporters.


npm install gulp-stylelint --save-dev

Quick start

Once you have configured stylelint (e.g. you have a .stylelintrc file), start with the following code. You will find additional configuration options below.

const gulp = require('gulp');

gulp.task('lint-css', function lintCssTask() {
  const gulpStylelint = require('gulp-stylelint');

  return gulp
      reporters: [
        {formatter: 'string', console: true}


Below is the list of currently available stylelint formatters. Some of them are bundled with stylelint by default and exposed on gulpStylelint.formatters object. Others need to be installed. You can write a custom formatter to tailor the reporting to your needs.

  • "string" (same as gulpStylelint.formatters.string) – bundled with stylelint
  • "verbose" (same as gulpStylelint.formatters.verbose) – bundled with stylelint
  • "json" (same as gulpStylelint.formatters.json) – bundled with stylelint
  • stylelint-checkstyle-formatter – requires installation


gulp-stylelint supports all stylelint options except files and formatter and accepts a custom set of options listed below:

const gulp = require('gulp');

gulp.task('lint-css', function lintCssTask() {
  const gulpStylelint = require('gulp-stylelint');
  const myStylelintFormatter = require('my-stylelint-formatter');

  return gulp
      failAfterError: true,
      reportOutputDir: 'reports/lint',
      reporters: [
        {formatter: 'verbose', console: true},
        {formatter: 'json', save: 'report.json'},
        {formatter: myStylelintFormatter, save: 'my-custom-report.txt'}
      debug: true


When set to true, the process will end with non-zero error code if any error-level warnings were raised. Defaults to true.


Base directory for lint results written to filesystem. Defaults to current working directory.


List of reporter configuration objects (see below). Defaults to an empty array.

  // stylelint results formatter (required):
  // - pass a function for imported, custom or exposed formatters
  // - pass a string ("string", "verbose", "json") for formatters bundled with stylelint
  formatter: myFormatter,

  // save the formatted result to a file (optional):
  save: 'text-report.txt',

  // log the formatted result to console (optional):
  console: true


When set to true, the error handler will print an error stack trace. Defaults to false.


MIT License

Related Repositories



A mighty, modern CSS linter ...



Set of front-end tools for Magento 2 based on Gulp.js ...



An ES6 boilerplate with common frontend tasks using Gulp 4 as build system. ...



Markup builder on gulp without jokes ...



Boilerplate for gulp-based project. ...

Top Contributors

olegskl greenkeeperio-bot proll jmeas gitter-badger chatii2412


-   3.4.0 zip tar
-   3.3.0 zip tar
-   3.2.0 zip tar
-   3.1.0 zip tar
-   3.0.0 zip tar
-   2.0.2 zip tar
-   2.0.1 zip tar
-   2.0.0 zip tar
-   1.1.0 zip tar
-   1.0.0 zip tar
-   1.0.0-beta.1 zip tar
-   1.0.0-beta.0 zip tar
-   0.2.0 zip tar
-   0.1.1 zip tar
-   0.1.0 zip tar
-   0.0.4 zip tar
-   0.0.3 zip tar
-   0.0.2 zip tar
-   0.0.1 zip tar