mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-29 01:45:40 +08:00
Fix message massaging for ESLint warnings
This commit is contained in:
@@ -32,6 +32,15 @@ function formatMessage(message, isError) {
|
||||
return message.indexOf('Thread Loader (Worker') === -1;
|
||||
});
|
||||
|
||||
// Strip `ModuleWarning` head off message before parsing (because of ESLint)
|
||||
// https://github.com/webpack/webpack/blob/c77030573de96b8293c69dd396492f8e2d46561e/lib/ModuleWarning.js
|
||||
var moduleWarningPrefix = 'Module Warning: ';
|
||||
if (lines[1].indexOf(moduleWarningPrefix) === 0) {
|
||||
lines[1] = lines[1].slice(moduleWarningPrefix.length);
|
||||
} else if (lines[1].match(/Module Warning \(from.*?\):/)) {
|
||||
lines.splice(1, 1);
|
||||
}
|
||||
|
||||
// Strip `ModuleError` header off message before parsing
|
||||
// https://github.com/webpack/webpack/blob/c77030573de96b8293c69dd396492f8e2d46561e/lib/ModuleError.js
|
||||
var moduleErrorPrefix = 'Module Error: ';
|
||||
|
||||
Reference in New Issue
Block a user