-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
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.
mandriv, glen-84, sindresorhus, jalooc, Stumblinbear and 5 more
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin