Skip to content

Commit

Permalink
refactor(formatter/text): Remove obsolete message grouping
Browse files Browse the repository at this point in the history
Grouping by rules has been removed with
SAP#6 but it was missed to remove the
corresponding data structures.
  • Loading branch information
RandomByte committed Aug 21, 2024
1 parent c42230b commit 6df2ed3
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/formatter/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,10 @@ export class Text {

this.#writeln(chalk.inverse(path.resolve(process.cwd(), filePath)));

// Group messages by rule
const rules = new Map<string, LintMessage[]>();
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;
}
Expand Down

0 comments on commit 6df2ed3

Please sign in to comment.