You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-20Lines changed: 32 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,9 @@
12
12
13
13
# stylelint-webpack-plugin
14
14
15
-
> This version of stylelint-webpack-plugin only works with webpack 5. For the webpack 4, see the [2.x branch](https://github.com/webpack-contrib/stylelint-webpack-plugin/tree/2.x).
15
+
> This version of `stylelint-webpack-plugin` only works with webpack 5. For webpack 4, see the [2.x branch](https://github.com/webpack-contrib/stylelint-webpack-plugin/tree/2.x).
16
16
17
-
This plugin uses [`stylelint`](https://stylelint.io/) that helps you avoid errors and enforce conventions in your styles.
17
+
This plugin uses [`stylelint`](https://stylelint.io/), which helps you avoid errors and enforce conventions in your styles.
18
18
19
19
## Getting Started
20
20
@@ -58,9 +58,9 @@ pnpm add -D stylelint
58
58
59
59
> [!NOTE]
60
60
>
61
-
> If you are using Stylelint 13 rather than 14+, you might also need to install `@types/stylelint` as a dev dependency if getting stylelint related type errors.
61
+
> If you are using Stylelint 13 rather than 14+, you might also need to install `@types/stylelint` as a dev dependency if you encounter Stylelint-related type errors.
62
62
63
-
Then add the plugin to your webpack config. For example:
63
+
Then add the plugin to your webpack configuration. For example:
See [stylelint's options](https://stylelint.io/user-guide/usage/node-api#options) for the complete list of options available. These options are passed through to the `stylelint` directly.
77
+
See [stylelint's options](https://stylelint.io/user-guide/usage/node-api#options) for the complete list of available options . These options are passed directly to `stylelint`.
Specify the path to the cache location. Can be a file or a directory.
101
+
Specify the path to the cache location. This can be a file or a directory.
102
102
103
103
### `configFile`
104
104
@@ -150,7 +150,7 @@ type extensions = string | Array<string>;
150
150
151
151
- Default: `['css', 'scss', 'sass']`
152
152
153
-
Specify extensions that should be checked.
153
+
Specify the extensions that should be checked.
154
154
155
155
### `files`
156
156
@@ -162,7 +162,7 @@ type files = string | Array<string>;
162
162
163
163
- Default: `null`
164
164
165
-
Specify directories, files, or globs. Must be relative to `options.context`. Directories are traversed recursively looking for files matching `options.extensions`. File and glob patterns ignore `options.extensions`.
165
+
Specify directories, files, or globs. Must be relative to `options.context`. Directories are traversed recursively, looking for files matching `options.extensions`. File and glob patterns ignore `options.extensions`.
166
166
167
167
### `fix`
168
168
@@ -188,7 +188,7 @@ type formatter = string | (
188
188
189
189
- Default: `'string'`
190
190
191
-
Specify the formatter that you would like to use to format your results. See [formatter option](https://stylelint.io/user-guide/usage/options#formatter).
191
+
Specify the formatter you would like to use to format your results. See the [formatter option](https://stylelint.io/user-guide/usage/options#formatter).
192
192
193
193
### `lintDirtyModulesOnly`
194
194
@@ -200,7 +200,7 @@ type lintDirtyModulesOnly = boolean;
200
200
201
201
- Default: `false`
202
202
203
-
Lint only changed files, skip lint on start.
203
+
Lint only changed files; skip linting on start.
204
204
205
205
### `stylelintPath`
206
206
@@ -224,12 +224,15 @@ type threads = boolean | number;
224
224
225
225
- Default: `false`
226
226
227
-
Set to true for an auto-selected pool size based on number of cpus. Set to a number greater than 1 to set an explicit pool size. Set to false, 1, or less to disable and only run in main process.
227
+
Set to `true` for an auto-selected pool size based on number of CPUs. Set to a number greater than 1 to set an explicit pool size.
228
+
229
+
Set to `false`, 1, or less to disable and run only in main process.
228
230
229
231
### Errors and Warning
230
232
231
-
**By default the plugin will auto adjust error reporting depending on stylelint errors/warnings counts.**
232
-
You can still force this behavior by using `emitError`**or**`emitWarning` options:
233
+
**By default, the plugin will automatically adjust error reporting depending on the number of Stylelint errors/warnings.**
234
+
235
+
You can still force this behavior by using the `emitError`**or**`emitWarning` options:
233
236
234
237
#### `emitError`
235
238
@@ -241,7 +244,7 @@ type emitError = boolean;
241
244
242
245
- Default: `true`
243
246
244
-
The errors found will always be emitted, to disable set to `false`.
247
+
The errors found will always be emitted. To disable, set to `false`.
245
248
246
249
#### `emitWarning`
247
250
@@ -253,7 +256,7 @@ type emitWarning = boolean;
253
256
254
257
- Default: `true`
255
258
256
-
The warnings found will always be emitted, to disable set to `false`.
259
+
The warnings found will always be emitted. To disable, set to `false`.
257
260
258
261
#### `failOnError`
259
262
@@ -265,7 +268,7 @@ type failOnError = boolean;
265
268
266
269
- Default: `true`
267
270
268
-
Will cause the module build to fail if there are any errors, to disable set to `false`.
271
+
Will cause the module build to fail if there are any errors. To disable, set to `false`.
269
272
270
273
#### `failOnWarning`
271
274
@@ -277,7 +280,7 @@ type failOnWarning = boolean;
277
280
278
281
- Default: `false`
279
282
280
-
Will cause the module build to fail if there are any warnings, if set to `true`.
283
+
Will cause the module build to fail if there are any warnings, when set to `true`.
281
284
282
285
#### `quiet`
283
286
@@ -289,7 +292,7 @@ type quiet = boolean;
289
292
290
293
- Default: `false`
291
294
292
-
Will process and report errors only and ignore warnings, if set to `true`.
295
+
Will process and report errors only, and ignore warnings, when set to `true`.
293
296
294
297
#### `outputReport`
295
298
@@ -311,9 +314,11 @@ type outputReport =
311
314
312
315
- Default: `false`
313
316
314
-
Write the output of the errors to a file, for example a `json` file for use for reporting.
317
+
Writes the output of the errors to a file - for example, a `json` file for use for reporting.
318
+
315
319
The `filePath` is relative to the webpack config: `output.path`.
316
-
You can pass in a different formatter for the output file, if none is passed in the default/configured formatter will be used.
320
+
321
+
You can pass in a different formatter for the output file. If none is passed in the default/configured formatter will be used.
317
322
318
323
```js
319
324
{
@@ -326,6 +331,13 @@ You can pass in a different formatter for the output file, if none is passed in
326
331
327
332
[Changelog](CHANGELOG.md)
328
333
334
+
## Contributing
335
+
336
+
We welcome all contributions!
337
+
If you're new here, please take a moment to review our contributing guidelines before submitting issues or pull requests.
0 commit comments