From 6df2ed3ddc0d2fc62d69d74993056cb7aebef8e8 Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Wed, 21 Aug 2024 16:26:26 +0200 Subject: [PATCH] refactor(formatter/text): Remove obsolete message grouping Grouping by rules has been removed with https://github.com/SAP/ui5-linter/pull/6 but it was missed to remove the corresponding data structures. --- src/formatter/text.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/formatter/text.ts b/src/formatter/text.ts index 9ee7b82c0..38b7c1d3b 100644 --- a/src/formatter/text.ts +++ b/src/formatter/text.ts @@ -56,17 +56,10 @@ export class Text { this.#writeln(chalk.inverse(path.resolve(process.cwd(), filePath))); - // Group messages by rule - const rules = new Map(); - let maxLine = 0; // Needed for formatting - let maxColumn = 0; // Needed for formatting + // Determine maximum line and column for position formatting + let maxLine = 0; + let maxColumn = 0; messages.forEach((msg) => { - const entry = rules.get(msg.ruleId); - if (entry) { - entry.push(msg); - } else { - rules.set(msg.ruleId, [msg]); - } if (msg.line && msg.line > maxLine) { maxLine = msg.line; }