static countViolationsByRule(messages) {
		return messages.reduce((totals, message) => {
			if (message.severity === 2 && message.ruleId) {
				totals[message.ruleId] ??= { count: 0 };
				totals[message.ruleId].count++;
			}
			return totals;
		}, {});
	}
Counts the violations by rule, ignoring warnings.
@param {LintMessage[]} messages The messages to count.
@returns {Record<string, number>} The number of violations by rule.