<commit_before># Stylelint Plugin for webpack

## Install

```console
$ npm install stylelint-webpack-plugin
```

## Usage

In your webpack configuration

```js
var styleLintPlugin = require('stylelint-webpack-plugin');


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

### Options

See [stylelint options](http://stylelint.io/user-guide/node-api/#options), for the complete list of options.

* `configFile`: You can change the config file location. Default: (`.stylelintrc`)
* `context`: String indicating the root of your SCSS files. Default inherits from webpack config.
* `files`: Change the glob pattern for finding files. Default: (`['**/*.s?(a|c)ss']`)
* `formatter`: Use a custom formatter to print errors to the console. Default: (`require('stylelint/dist/formatters/stringFormatter').default`)
* `failOnError`: Have Webpack's build process die on error. Default: `false`
* `quiet`: Don't print stylelint output to the console. Default: `false`


```js
// Default settings
module.exports = {
  plugins: [
    new styleLintPlugin({
      configFile: '.stylelintrc',
      context: 'inherits from webpack',
      files: '**/*.s?(a|c)ss',
      failOnError: false,
    })
  ]
}
```
<commit_msg>docs: update readme<commit_after># Stylelint Plugin for webpack

### Why you might want to use this plugin instead of [stylelint-loader](https://github.com/adrianhall/stylelint-loader)

**stylelint-loader** lints the files you `require` or the ones you define as an `entry` in your webpack config. But `@imports` in those files are not followed, so just the main file (for each require/entry) is linted.

Instead, with **stylelint-webpack-plugin** you just define file globs, like stylelint does by default. So you get all your files linted.


## Install

```console
$ npm install stylelint-webpack-plugin
```

## Usage

In your webpack configuration

```js
var styleLintPlugin = require('stylelint-webpack-plugin');


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

### Options

See [stylelint options](http://stylelint.io/user-guide/node-api/#options), for the complete list of options.

* `configFile`: You can change the config file location. Default: (`.stylelintrc`)
* `context`: String indicating the root of your SCSS files. Default inherits from webpack config.
* `files`: Change the glob pattern for finding files. Default: (`['**/*.s?(a|c)ss']`)
* `syntax`: Use `'scss'` to lint .scss files. Default (`undefined`)
* `formatter`: Use a custom formatter to print errors to the console. Default: (`require('stylelint/dist/formatters/stringFormatter').default`)
* `failOnError`: Have Webpack's build process die on error. Default: `false`
* `quiet`: Don't print stylelint output to the console. Default: `false`


```js
// Default settings
module.exports = {
  plugins: [
    new styleLintPlugin({
      configFile: '.stylelintrc',
      context: 'inherits from webpack',
      files: '**/*.s?(a|c)ss',
      failOnError: false,
    })
  ]
}
```

{'fraction_non_alphanumeric': 0.1443163097199341, 'fraction_numerical': 0.0, 'mean_word_length': 4.026490066225166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3561321', 'n_tokens_mistral': 962, 'n_tokens_neox': 907, 'n_words': 312}