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
@@ -21,16 +21,40 @@ This plugin uses [`eslint`](https://eslint.org/) to find and fix problems in you
21
21
22
22
To begin, you'll need to install `eslint-webpack-plugin`:
23
23
24
-
```bash
24
+
```console
25
25
npm install eslint-webpack-plugin --save-dev
26
26
```
27
27
28
+
or
29
+
30
+
```console
31
+
yarn add -D install eslint-webpack-plugin
32
+
```
33
+
34
+
or
35
+
36
+
```console
37
+
pnpm add -D eslint-webpack-plugin
38
+
```
39
+
28
40
**Note**: You also need to install `eslint >= 7` from npm, if you haven't already:
29
41
30
-
```bash
42
+
```console
31
43
npm install eslint --save-dev
32
44
```
33
45
46
+
or
47
+
48
+
```console
49
+
yarn add -D eslint
50
+
```
51
+
52
+
or
53
+
54
+
```console
55
+
pnpm add -D eslint
56
+
```
57
+
34
58
Then add the plugin to your webpack config. For example:
35
59
36
60
```js
@@ -55,35 +79,60 @@ See the [eslint docs](https://eslint.org/docs/developer-guide/nodejs-api#-new-es
55
79
56
80
### `context`
57
81
58
-
- Type: `String`
82
+
- Type:
83
+
84
+
```ts
85
+
typecontext=string;
86
+
```
87
+
59
88
- Default: `compiler.context`
60
89
61
90
A string indicating the root of your files.
62
91
63
92
### `eslintPath`
64
93
65
-
- Type: `String`
94
+
- Type:
95
+
96
+
```ts
97
+
typeeslintPath=string;
98
+
```
99
+
66
100
- Default: `eslint`
67
101
68
102
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`.
69
103
70
104
### `extensions`
71
105
72
-
- Type: `String|Array[String]`
106
+
- Type:
107
+
108
+
```ts
109
+
typeextensions=string|Array<string>;
110
+
```
111
+
73
112
- Default: `'js'`
74
113
75
114
Specify extensions that should be checked.
76
115
77
116
### `exclude`
78
117
79
-
- Type: `String|Array[String]`
118
+
- Type:
119
+
120
+
```ts
121
+
typeexclude=string|Array<string>;
122
+
```
123
+
80
124
- Default: `'node_modules'`
81
125
82
126
Specify the files and/or directories to exclude. Must be relative to `options.context`.
83
127
84
128
### `files`
85
129
86
-
- Type: `String|Array[String]`
130
+
- Type:
131
+
132
+
```ts
133
+
typefiles=string|Array<string>;
134
+
```
135
+
87
136
- Default: `null`
88
137
89
138
Specify directories, files, or globs. Must be relative to `options.context`.
@@ -92,7 +141,12 @@ File and glob patterns ignore `options.extensions`.
92
141
93
142
### `fix`
94
143
95
-
- Type: `Boolean`
144
+
- Type:
145
+
146
+
```ts
147
+
typefix=boolean;
148
+
```
149
+
96
150
- Default: `false`
97
151
98
152
Will enable [ESLint autofix feature](https://eslint.org/docs/developer-guide/nodejs-api#-eslintoutputfixesresults).
@@ -101,21 +155,39 @@ Will enable [ESLint autofix feature](https://eslint.org/docs/developer-guide/nod
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/).
108
170
109
171
### `lintDirtyModulesOnly`
110
172
111
-
- Type: `Boolean`
173
+
- Type:
174
+
175
+
```ts
176
+
typelintDirtyModulesOnly=boolean;
177
+
```
178
+
112
179
- Default: `false`
113
180
114
181
Lint only changed files, skip lint on start.
115
182
116
183
### `threads`
117
184
118
-
- Type: `Boolean | Number`
185
+
- Type:
186
+
187
+
```ts
188
+
typethreads=boolean|number;
189
+
```
190
+
119
191
- Default: `false`
120
192
121
193
Will run lint tasks across a thread pool. The pool size is automatic unless you specify a number.
@@ -127,42 +199,85 @@ You can still force this behavior by using `emitError` **or** `emitWarning` opti
127
199
128
200
#### `emitError`
129
201
130
-
- Type: `Boolean`
202
+
- Type:
203
+
204
+
```ts
205
+
typeemitError=boolean;
206
+
```
207
+
131
208
- Default: `true`
132
209
133
210
The errors found will always be emitted, to disable set to `false`.
134
211
135
212
#### `emitWarning`
136
213
137
-
- Type: `Boolean`
214
+
- Type:
215
+
216
+
```ts
217
+
typeemitWarning=boolean;
218
+
```
219
+
138
220
- Default: `true`
139
221
140
222
The warnings found will always be emitted, to disable set to `false`.
141
223
142
224
#### `failOnError`
143
225
144
-
- Type: `Boolean`
226
+
- Type:
227
+
228
+
```ts
229
+
typefailOnError=boolean;
230
+
```
231
+
145
232
- Default: `true`
146
233
147
234
Will cause the module build to fail if there are any errors, to disable set to `false`.
148
235
149
236
#### `failOnWarning`
150
237
151
-
- Type: `Boolean`
238
+
- Type:
239
+
240
+
```ts
241
+
typefailOnWarning=boolean;
242
+
```
243
+
152
244
- Default: `false`
153
245
154
246
Will cause the module build to fail if there are any warnings, if set to `true`.
155
247
156
248
#### `quiet`
157
249
158
-
- Type: `Boolean`
250
+
- Type:
251
+
252
+
```ts
253
+
typequiet=boolean;
254
+
```
255
+
159
256
- Default: `false`
160
257
161
258
Will process and report errors only and ignore warnings, if set to `true`.
0 commit comments