Closed
Description
I would like to propose a new rule: no-duplicate-union-intersection
.
This rule reports duplicates in unions and intersections. The autofixer will remove all duplicates, keeping the first one.
The following lines will be reported:
type A = 1 | 2 | 3 | 1;
type B = 'foo' | 'bar' | 'foo';
type C = A | B | A | B;
This will be autofixed to:
type A = 1 | 2 | 3;
type B = 'foo' | 'bar';
type C = A | B;
The rule won’t try to resolve references. This may be an addition for later.
If this is accepted, I’m willing to implement this.