Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
typeX=number|(string|number);
ESLint Config
module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/no-duplicate-type-constituents":"error",},};
tsconfig
{}Expected Result
This code snippet does contain a duplicate type constituent. The rule does report it, but only if the parentheses (which are unnecessary) are removed.
Actual Result
The duplicate type constituent is not reported by the rule.
Additional Info
Reported by@auvred in#9479(comment).
- Do we care about this issue?
- We'd need to implement a bit of recursion in order to account for this.
- You can only get into this scenario if you have enabled this rule, you are not using ESLint Stylistic (with its
no-extra-parensrule), and you are not using a formatter (like Prettier). - Are there similar cases with extraneous parentheses in other rules, and are they handled or not?