Skip to content

Commit

Permalink
refactor(plugin-eslint): remove unnecessary Set wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
hanna-skryl committed Jan 23, 2025
1 parent ffd4afe commit af5c632
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/plugin-eslint/src/lib/meta/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,13 @@ export function resolveGroupRefs(
groupRules: Record<string, number>,
rulesMap: Record<string, RuleData[]>,
): { refs: Group['refs']; invalidRules: string[] } {
const uniqueRuleIds = [...new Set(Object.keys(rulesMap))];

return Object.entries(groupRules).reduce<{
refs: Group['refs'];
invalidRules: string[];
}>(
(acc, [rule, weight]) => {
const matchedRuleIds = rule.endsWith('*')
? expandWildcardRules(rule, uniqueRuleIds)
? expandWildcardRules(rule, Object.keys(rulesMap))
: [rule];

const matchedRefs = matchedRuleIds.flatMap(ruleId => {
Expand Down

0 comments on commit af5c632

Please sign in to comment.