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
+47-21
Original file line number
Diff line number
Diff line change
@@ -57,89 +57,113 @@ export default {
57
57
58
58
## Options
59
59
60
-
You can pass [eslint options](http://eslint.org/docs/developer-guide/nodejs-api#cliengine).
60
+
You can pass [eslint options](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions).
61
61
62
-
**Note**: That the config option you provide will be passed to the `CLIEngine`. This is a different set of options than what you'd specify in `package.json` or `.eslintrc`. See the [eslint docs](http://eslint.org/docs/developer-guide/nodejs-api#cliengine) for more detail.
62
+
Note that the config option you provide will be passed to the `ESLint` class.
63
+
This is a different set of options than what you'd specify in `package.json` or `.eslintrc`.
64
+
See the [eslint docs](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions) for more details.
63
65
64
-
### `cache`
66
+
**Warning**: In eslint-webpack-plugin version 1 the options were passed to the now deprecated [CLIEngine](https://eslint.org/docs/developer-guide/nodejs-api#cliengine).
65
67
66
-
- Type: `Boolean|String`
67
-
- Default: `false`
68
+
### `cache``
69
+
70
+
- Type: `Boolean`
71
+
- Default: `true`
68
72
69
-
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.
73
+
**Note**: The cache is enabled by default to decrease execution time.
70
74
71
-
This can either be a `boolean` value or the cache directory path(ex: `'./.eslint-loader-cache'`).
75
+
### `context`
72
76
73
-
If `cache: true` is used, the cache is written to the `./node_modules/.cache/eslint-loader` directory. This is the recommended usage.
77
+
- Type: `String`
78
+
- Default: `srcDir`
79
+
80
+
A string indicating the root of your files.
74
81
75
82
### `eslintPath`
76
83
77
84
- Type: `String`
78
85
- Default: `eslint`
79
86
80
-
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`.
87
+
Path to `eslint` instance that will be used for linting.
88
+
89
+
### `files`
90
+
91
+
- Type: `String|Array[String]`
92
+
- Default: `'.'`
93
+
94
+
Specify directories, files, or globs. Must be relative to `options.context`.
95
+
Directories are traversed recursively looking for files matching `options.extensions`.
96
+
File and glob patterns ignore `options.extensions`.
81
97
82
98
### `extensions`
83
99
84
-
- Type: `Array[String]`
100
+
- Type: `String|Array[String]`
85
101
- Default: `['ts', 'js', 'vue']`
86
102
87
-
Extensions that will be used by the loader.
103
+
Specify extensions that should be checked.
88
104
89
105
### `fix`
90
106
91
107
- Type: `Boolean`
92
108
- Default: `false`
93
109
94
-
This option will enable [ESLint autofix feature](http://eslint.org/docs/user-guide/command-line-interface#fix).
110
+
Will enable [ESLint autofix feature](https://eslint.org/docs/developer-guide/nodejs-api#cliengineoutputfixes).
95
111
96
112
**Be careful: this option will change source files.**
97
113
98
114
### `formatter`
99
115
100
116
- Type: `String|Function`
101
-
- Default: `stylish`
117
+
- Default: `'stylish'`
118
+
119
+
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/).
120
+
121
+
### `lintDirtyModulesOnly`
122
+
123
+
- Type: `Boolean`
124
+
- Default: `true`
102
125
103
-
This option 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/).
126
+
Lint only changed files, skip lint on start.
104
127
105
128
### Errors and Warning
106
129
107
-
**By default the loader will auto adjust error reporting depending on eslint errors/warnings counts.** You can still force this behavior by using `emitError`**or**`emitWarning` options:
130
+
**By default the plugin will auto adjust error reporting depending on eslint errors/warnings counts.**
131
+
You can still force this behavior by using `emitError`**or**`emitWarning` options:
108
132
109
133
#### `emitError`
110
134
111
135
- Type: `Boolean`
112
136
- Default: `false`
113
137
114
-
Will always return errors, if this option is set to `true`.
138
+
Will always return errors, if set to `true`.
115
139
116
140
#### `emitWarning`
117
141
118
142
- Type: `Boolean`
119
143
- Default: `false`
120
144
121
-
Will always return warnings, if option is set to `true`.
145
+
Will always return warnings, if set to `true`.
122
146
123
147
#### `failOnError`
124
148
125
149
- Type: `Boolean`
126
150
- Default: `false`
127
151
128
-
Will cause the module build to fail if there are any errors, if option is set to `true`.
152
+
Will cause the module build to fail if there are any errors, if set to `true`.
129
153
130
154
#### `failOnWarning`
131
155
132
156
- Type: `Boolean`
133
157
- Default: `false`
134
158
135
-
Will cause the module build to fail if there are any warnings, if option is set to `true`.
159
+
Will cause the module build to fail if there are any warnings, if set to `true`.
136
160
137
161
#### `quiet`
138
162
139
163
- Type: `Boolean`
140
164
- Default: `false`
141
165
142
-
Will process and report errors only and ignore warnings, if this option is set to `true`.
166
+
Will process and report errors only and ignore warnings, if set to `true`.
143
167
144
168
#### `outputReport`
145
169
@@ -148,7 +172,9 @@ Will process and report errors only and ignore warnings, if this option is set t
148
172
149
173
Write the output of the errors to a file, for example a checkstyle xml file for use for reporting on Jenkins CI.
150
174
151
-
The `filePath` is an absolute path or relative to the webpack config: `output.path`. You can pass in a different `formatter` for the output file, if none is passed in the default/configured formatter will be used.
175
+
The `filePath` is an absolute path or relative to the webpack config: `output.path`.
176
+
You can pass in a different `formatter` for the output file,
177
+
if none is passed in the default/configured formatter will be used.
0 commit comments