@sdvg/stylelint-loader

Stylelint loader for Webpack 4

Usage no npm install needed!

<script type="module">
  import sdvgStylelintLoader from 'https://cdn.skypack.dev/@sdvg/stylelint-loader';
</script>

README

Webpack Stylelint loader

Stylelint loader for Webpack 4.

Installation

$ npm install -D @sdvg/stylelint-loader

You also need to install Stylelint and provide a config:

$ npm install -D stylelint

Add as first loader (last in Array) for your styles like this:

{
    test: /\.css$/,
    use: [
      'style-loader',
      'css-loader',
      {
        loader: '@sdvg/stylelint-loader',
        options: {
          ...
        }
      }
    ]
}

Options

Option Default Description
quiet false Suppress Stylelint output
emitError false Emit all warnings and errors as errors (recommended for production builds)
emitWarning false Emit all warnings and errors as warnings (recommended when using Hot Module Reloading)

By default Stylelint warnings are emitted as warnings and Stylelint errors as errors.

The following options are passed directly to Stylelint:

License

MIT License