stylelint-webpack-plugin 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/linter.js +10 -32
- package/package.json +1 -1
package/dist/linter.js
CHANGED
|
@@ -215,24 +215,20 @@ function parseResults(options, results) {
|
|
|
215
215
|
|
|
216
216
|
const warnings = [];
|
|
217
217
|
results.forEach(file => {
|
|
218
|
-
|
|
219
|
-
const messages = file.warnings.filter(message => options.emitError && message.severity === 'error');
|
|
218
|
+
const fileErrors = file.warnings.filter(message => options.emitError && message.severity === 'error');
|
|
220
219
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
220
|
+
if (fileErrors.length > 0) {
|
|
221
|
+
errors.push({ ...file,
|
|
222
|
+
warnings: fileErrors
|
|
223
|
+
});
|
|
226
224
|
}
|
|
227
225
|
|
|
228
|
-
|
|
229
|
-
const messages = file.warnings.filter(message => options.emitWarning && message.severity === 'warning');
|
|
226
|
+
const fileWarnings = file.warnings.filter(message => options.emitWarning && message.severity === 'warning');
|
|
230
227
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
228
|
+
if (fileWarnings.length > 0) {
|
|
229
|
+
warnings.push({ ...file,
|
|
230
|
+
warnings: fileWarnings
|
|
231
|
+
});
|
|
236
232
|
}
|
|
237
233
|
});
|
|
238
234
|
return {
|
|
@@ -240,24 +236,6 @@ function parseResults(options, results) {
|
|
|
240
236
|
warnings
|
|
241
237
|
};
|
|
242
238
|
}
|
|
243
|
-
/**
|
|
244
|
-
* @param {LintResult} file
|
|
245
|
-
* @returns {boolean}
|
|
246
|
-
*/
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
function fileHasErrors(file) {
|
|
250
|
-
return !!file.errored;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* @param {LintResult} file
|
|
254
|
-
* @returns {boolean}
|
|
255
|
-
*/
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
function fileHasWarnings(file) {
|
|
259
|
-
return file.warnings && file.warnings.length > 0;
|
|
260
|
-
}
|
|
261
239
|
/**
|
|
262
240
|
* @param {Stylelint} stylelint
|
|
263
241
|
* @param {FormatterType=} formatter
|