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
{{ message }}
This repository was archived by the owner on Sep 28, 2020. It is now read-only.
**By default the loader will auto adjust error reporting depending
190
238
on eslint errors/warnings counts.**
191
239
You can still force this behavior by using `emitError`**or**`emitWarning` options:
192
240
193
-
#####`emitError` (default: `false`)
241
+
#### `emitError`
194
242
195
-
Loader will always return errors if this option is set to `true`.
243
+
- Type: `Boolean`
244
+
- Default: `false`
245
+
246
+
Will always return errors, if this option is set to `true`.
196
247
197
248
```js
198
249
module.exports= {
@@ -212,14 +263,37 @@ module.exports = {
212
263
};
213
264
```
214
265
215
-
#####`emitWarning` (default: `false`)
266
+
#### `emitWarning`
216
267
217
-
Loader will always return warnings if option is set to `true`. If you're using hot module replacement,
218
-
you may wish to enable this in development, or else updates will be skipped when there's an eslint error.
268
+
- Type: `Boolean`
269
+
- Default: `false`
219
270
220
-
##### `quiet` (default: `false`)
271
+
Will always return warnings, if option is set to `true`. **If you're using hot module replacement, you may wish to enable this in development, or else updates will be skipped when there's an eslint error.**
221
272
222
-
Loader will process and report errors only and ignore warnings if this option is set to true
273
+
```js
274
+
module.exports= {
275
+
entry:'...',
276
+
module: {
277
+
rules: [
278
+
{
279
+
test:/\.js$/,
280
+
exclude:/node_modules/,
281
+
loader:'eslint-loader',
282
+
options: {
283
+
emitWarning:true,
284
+
},
285
+
},
286
+
],
287
+
},
288
+
};
289
+
```
290
+
291
+
#### `failOnError`
292
+
293
+
- Type: `Boolean`
294
+
- Default: `false`
295
+
296
+
Will cause the module build to fail if there are any errors, if option is set to `true`.
223
297
224
298
```js
225
299
module.exports= {
@@ -231,17 +305,20 @@ module.exports = {
231
305
exclude:/node_modules/,
232
306
loader:'eslint-loader',
233
307
options: {
234
-
quiet:true,
308
+
failOnError:true,
235
309
},
236
310
},
237
311
],
238
312
},
239
313
};
240
314
```
241
315
242
-
#####`failOnWarning` (default: `false`)
316
+
#### `failOnWarning`
243
317
244
-
Loader will cause the module build to fail if there are any eslint warnings.
318
+
- Type: `Boolean`
319
+
- Default: `false`
320
+
321
+
Will cause the module build to fail if there are any warnings, if option is set to `true`.
245
322
246
323
```js
247
324
module.exports= {
@@ -261,9 +338,12 @@ module.exports = {
261
338
};
262
339
```
263
340
264
-
##### `failOnError` (default: `false`)
341
+
#### `quiet`
342
+
343
+
- Type: `Boolean`
344
+
- Default: `false`
265
345
266
-
Loader will cause the module build to fail if there are any eslint errors.
346
+
Will process and report errors only and ignore warnings, if this option is set to `true`.
267
347
268
348
```js
269
349
module.exports= {
@@ -275,20 +355,23 @@ module.exports = {
275
355
exclude:/node_modules/,
276
356
loader:'eslint-loader',
277
357
options: {
278
-
failOnError:true,
358
+
quiet:true,
279
359
},
280
360
},
281
361
],
282
362
},
283
363
};
284
364
```
285
365
286
-
##### `outputReport` (default: `null`)
366
+
#### `outputReport`
367
+
368
+
- Type: `Boolean|Object`
369
+
- Default: `false`
287
370
288
371
Write the output of the errors to a file, for example a checkstyle xml file for use for reporting on Jenkins CI
289
372
290
-
The `filePath` is an absolute path or relative to the webpack config: output.path
291
-
You can pass in a different formatter for the output file,
373
+
The `filePath` is an absolute path or relative to the webpack config: `output.path`
374
+
You can pass in a different `formatter` for the output file,
292
375
if none is passed in the default/configured formatter will be used
Copy file name to clipboardExpand all lines: src/options.json
+11-11
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,21 @@
2
2
"type": "object",
3
3
"additionalProperties": true,
4
4
"properties": {
5
-
"fix": {
6
-
"description": "This option will enable ESLint autofix feature",
7
-
"type": "boolean"
8
-
},
9
5
"cache": {
10
6
"description": "This option will enable caching of the linting results into a file. This is particularly useful in reducing linting time when doing a full build.",
"description": "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 dont have to install `eslint` .",
11
+
"type": "string"
12
+
},
13
13
"formatter": {
14
14
"description": "Loader accepts a function that will have one argument: an array of eslint messages (object). The function must return the output as a string.",
"description": "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 dont have to install `eslint` .",
19
-
"type": "string"
17
+
"fix": {
18
+
"description": "This option will enable ESLint autofix feature",
19
+
"type": "boolean"
20
20
},
21
21
"emitError": {
22
22
"description": "Loader will always return errors if this option is set to `true`.",
@@ -26,16 +26,16 @@
26
26
"description": "Loader will always return warnings if option is set to `true`. If you're using hot module replacement, you may wish to enable this in development, or else updates will be skipped when there's an eslint error.",
27
27
"type": "boolean"
28
28
},
29
-
"quiet": {
30
-
"description": "Loader will process and report errors only and ignore warnings if this option is set to true",
29
+
"failOnError": {
30
+
"description": "Loader will cause the module build to fail if there are any eslint errors.",
31
31
"type": "boolean"
32
32
},
33
33
"failOnWarning": {
34
34
"description": "Loader will cause the module build to fail if there are any eslint warnings.",
35
35
"type": "boolean"
36
36
},
37
-
"failOnError": {
38
-
"description": "Loader will cause the module build to fail if there are any eslint errors.",
37
+
"quiet": {
38
+
"description": "Loader will process and report errors only and ignore warnings if this option is set to true",
0 commit comments