diff --git a/lib/compilers/clean.js b/lib/compilers/clean.js index d50b82be6..e5cf55978 100644 --- a/lib/compilers/clean.js +++ b/lib/compilers/clean.js @@ -48,26 +48,23 @@ class CleanCompiler extends BaseCompiler { const typeeerrorRegex = /^Type error \[.*,(\d*),(.*)\]:\s(.*)/i; return utils.splitLines(output).map(line => { let matches = line.match(errorRegex); + if (!matches) matches = line.match(typeeerrorRegex); + + if (matches) { + return ":" + matches[1] + ",0: error: (" + matches[2] + ") " + matches[3]; + } + + matches = line.match(errorLineRegex); if (matches) { return ":" + matches[1] + ",0: error: " + matches[2]; - } else { - matches = line.match(errorLineRegex); - if (matches) { - return ":" + matches[1] + ",0: error: (" + matches[2] + ") " + matches[3]; - } else { - matches = line.match(parseerrorRegex); - if (matches) { - return ":" + matches[1] + "," + matches[2] + ": error: (" + matches[3] + ") " + matches[3]; - } else { - matches = line.match(typeeerrorRegex); - if (matches) { - return ":" + matches[1] + ",0: error: (" + matches[2] + ") " + matches[3]; - } else { - return line; - } - } - } } + + matches = line.match(parseerrorRegex); + if (matches) { + return ":" + matches[1] + "," + matches[2] + ": error: (" + matches[3] + ") " + matches[4]; + } + + return line; }).join("\n"); }