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
+28-19Lines changed: 28 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,9 @@
12
12
13
13
# eslint-webpack-plugin
14
14
15
-
> This version of eslint-webpack-plugin only works with webpack 5. For the webpack 4, see the [2.x branch](https://github.com/webpack-contrib/eslint-webpack-plugin/tree/2.x).
15
+
> This version of eslint-webpack-plugin only supports webpack 5. For the webpack 4, see the [2.x branch](https://github.com/webpack-contrib/eslint-webpack-plugin/tree/2.x).
16
16
17
-
This plugin uses [`eslint`](https://eslint.org/) to find and fix problems in your JavaScript code
17
+
This plugin uses [`ESlint`](https://eslint.org/) to find and fix problems in your JavaScript code during the Webpack build process.
18
18
19
19
## Getting Started
20
20
@@ -56,7 +56,7 @@ or
56
56
pnpm add -D eslint
57
57
```
58
58
59
-
Then add the plugin to your webpack config. For example:
59
+
Then add the plugin to your webpack configuration. For example:
You can pass [eslint options](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions).
73
+
You can pass [ESLint Node.js API options](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions).
74
74
75
75
> [!NOTE]
76
76
>
77
77
> The config option you provide will be passed to the `ESLint` class.
78
78
> This is a different set of options than what you'd specify in `package.json` or `.eslintrc`.
79
-
> See the [eslint docs](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions) for more details.
79
+
> See the [ESlint docs](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions) for more details.
80
80
81
81
> [!WARNING]
82
82
>
83
-
> In eslint-webpack-plugin version 1 the options were passed to the nowdeprecated [CLIEngine](https://eslint.org/docs/developer-guide/nodejs-api#cliengine).
83
+
> In eslint-webpack-plugin version 1 the options were passed to the now-deprecated [CLIEngine](https://eslint.org/docs/developer-guide/nodejs-api#cliengine).
84
84
85
85
### `cache`
86
86
@@ -133,7 +133,7 @@ type context = string;
133
133
134
134
- Default: `compiler.context`
135
135
136
-
A string indicating the root of your files.
136
+
Base directory for linting.
137
137
138
138
### `eslintPath`
139
139
@@ -145,7 +145,8 @@ type eslintPath = string;
145
145
146
146
- Default: `eslint`
147
147
148
-
Path to `eslint` instance that will be used for linting. If the `eslintPath` is a folder like a official eslint, or specify a `formatter` option. now you don't have to install `eslint`.
148
+
Path to `eslint` instance that will be used for linting.
149
+
If the `eslintPath` is a folder like a official ESlint, or specify a `formatter` option, now you don't have to install `eslint`.
149
150
150
151
### `extensions`
151
152
@@ -157,7 +158,7 @@ type extensions = string | Array<string>;
157
158
158
159
- Default: `'js'`
159
160
160
-
Specify extensions that should be checked.
161
+
Specify file extensions that should be checked.
161
162
162
163
### `exclude`
163
164
@@ -169,7 +170,7 @@ type exclude = string | Array<string>;
169
170
170
171
- Default: `'node_modules'`
171
172
172
-
Specify the files and/or directories to exclude. Must be relative to `options.context`.
173
+
Specify the files/directories to exclude. Must be relative to `options.context`.
173
174
174
175
### `resourceQueryExclude`
175
176
@@ -209,7 +210,7 @@ type fix = boolean;
209
210
210
211
Will enable [ESLint autofix feature](https://eslint.org/docs/developer-guide/nodejs-api#-eslintoutputfixesresults).
211
212
212
-
**Be careful: this option will change source files.**
213
+
**Be careful: this option will modify source files.**
213
214
214
215
### `formatter`
215
216
@@ -224,7 +225,8 @@ type formatter = string| (
224
225
225
226
- Default: `'stylish'`
226
227
227
-
Accepts a function that will have one argument: an array of eslint messages (object). The function must return the output as a string. You can use official [eslint formatters](https://eslint.org/docs/user-guide/formatters/).
228
+
Accepts a function that receives an array of ESLint messages (object) as its argument and must return a string as output.
229
+
You can use official [ESlint formatters](https://eslint.org/docs/user-guide/formatters/).
228
230
229
231
### `lintDirtyModulesOnly`
230
232
@@ -236,7 +238,7 @@ type lintDirtyModulesOnly = boolean;
236
238
237
239
- Default: `false`
238
240
239
-
Lint only changed files, skip lint on start.
241
+
Lint only changed files, skipping initial lint on build start.
240
242
241
243
### `threads`
242
244
@@ -289,7 +291,7 @@ type failOnError = boolean;
289
291
290
292
- Default: `true`
291
293
292
-
Will cause the module build to fail if there are any errors, to disable set to `false`.
294
+
Will cause the module build to fail if any errors are found, to disable set to `false`.
293
295
294
296
#### `failOnWarning`
295
297
@@ -301,7 +303,7 @@ type failOnWarning = boolean;
301
303
302
304
- Default: `false`
303
305
304
-
Will cause the module build to fail if there are any warnings, if set to `true`.
306
+
Will cause the module build to fail if any warnings are found, if set to `true`.
305
307
306
308
#### `quiet`
307
309
@@ -338,16 +340,23 @@ type outputReport =
338
340
339
341
- Default: `false`
340
342
341
-
Write the output of the errors to a file, for example a checkstyle xml file for use for reporting on Jenkins CI.
343
+
Write ESLint results to a file, for example a checkstyle xml file for use for reporting on Jenkins CI.
342
344
343
-
The `filePath` is an absolute path or relative to the webpack config: `output.path`.
344
-
You can pass in a different `formatter` for the output file,
345
-
if none is passed in the default/configured formatter will be used.
345
+
-filePath: Path to output report file (relative to output.path or absolute).
346
+
- formatter: You can pass in a different `formatter` for the output file.
347
+
if none is passed in the default/configured formatter will be used.
346
348
347
349
## Changelog
348
350
349
351
[Changelog](CHANGELOG.md)
350
352
353
+
## Contributing
354
+
355
+
We welcome all contributions!
356
+
If you're new here, please take a moment to review our contributing guidelines.
0 commit comments