Home

Awesome

rollup-plugin-stylint

NPM version Dependency Status Code Climate

Rollup plugin to lint stylus with stylint

Installation

npm install rollup-plugin-stylint -D

Usage

import { rollup } from 'rollup';
import stylint from 'rollup-plugin-stylint';

rollup({
  entry: 'index.js',
  plugins: [
    stylint()
  ]
});

Options

configFile

Specify path to .stylintrc file with stylint options.

import { rollup } from 'rollup';
import stylint from 'rollup-plugin-stylint';

rollup({
  entry: 'index.js',
  plugins: [
    stylint({
      configFile: './.stylintrc'
    })
  ]
});

config

Or specify stylint options inline.

import { rollup } from 'rollup';
import stylint from 'rollup-plugin-stylint';

rollup({
  entry: 'index.js',
  plugins: [
    stylint({
      config: {
        brackets: 'always',
        namingConvention: 'BEM',
        semicolons: 'always'
      }
    })
  ]
});

Also config overrides configFile option.

reporter

You can use custom reporter for better console output.

import { rollup } from 'rollup';
import stylint from 'rollup-plugin-stylint';

rollup({
  entry: 'index.js',
  plugins: [
    stylint({
      reporter: 'stylint-stylish'
    })
  ]
});

License

MIT © Andrew Smirnov