stylelint-formatter-pretty

4.0.0 • Public • Published

stylelint-formatter-pretty

A pretty formatter for Stylelint

Test Coverage Status Install size XO code style MIT license

Screenshot

Install

Using npm:

npm install --save-dev stylelint-formatter-pretty

Using yarn:

yarn add stylelint-formatter-pretty --dev

Usage

Stylelint CLI

stylelint file.css --custom-formatter=node_modules/stylelint-formatter-pretty

grunt-stylelint

import stylelintFormatter from 'stylelint-formatter-pretty';

grunt.initConfig({
  stylelint: {
    options: {
      formatter: stylelintFormatter
    },
    all: ['css/**/*.css']
  }
});

grunt.loadNpmTasks('grunt-stylelint');
grunt.registerTask('default', ['stylelint']);

gulp-stylelint

import gulp from 'gulp';
import stylelint from 'gulp-stylelint';
import stylelintFormatter from 'stylelint-formatter-pretty';

gulp.task('lint', () =>
  gulp.src('file.css')
    .pipe(stylelint({
      reporters: [ {
        formatter: stylelintFormatter,
        console: true
      } ]
    }));
);

Webpack

import styleLintPlugin from 'stylelint-webpack-plugin';
import stylelintFormatter from 'stylelint-formatter-pretty';

module.exports = {
  // ...
  plugins: [
    new styleLintPlugin({
      formatter: stylelintFormatter
    }),
  ],
  // ...
}

Tips

In iTerm, Command+Click the filename header to open the file in your editor.

In terminals with support for hyperlinks, Command+Click the rule ID to open its documentation.

Related

License

MIT © Sindre Sorhus, Marc Görtz

Package Sidebar

Install

npm i stylelint-formatter-pretty

Weekly Downloads

21,272

Version

4.0.0

License

MIT

Unpacked Size

11.6 kB

Total Files

4

Last publish

Collaborators

  • dreamseer