From 49388146faf7803fe3ffe99c0ff2f60c19509fb9 Mon Sep 17 00:00:00 2001 From: Partouf Date: Sun, 14 Oct 2018 02:14:22 +0200 Subject: [PATCH] lintfixes --- lib/compilers/clean.js | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) 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"); }