Skip to content

Commit aa343f2

Browse files
committed
make it work in node 20
1 parent 1393016 commit aa343f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/plugins/eslint-plugin-react-x/src/rules/no-unused-props.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ export function create(context: RuleContext<MessageID, []>): RuleListener {
6767
}
6868
}
6969

70-
const unusedProps = totalDeclaredProps.difference(totalUsedProps);
70+
// TODO: Node 20 doesn't support Set.difference. Use it when minimum Node version is 22.
71+
const unusedProps = [...totalDeclaredProps].filter((x) => !totalUsedProps.has(x));
72+
7173
for (const unusedProp of unusedProps) {
7274
reportUnusedProp(context, services, unusedProp);
7375
}

0 commit comments

Comments
 (0)