-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a lookWaiting for team members to take a look
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 have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
// Broken #1
export interface TypeA { _id?: string }
export type TypeB = TypeA & { _id: string }
// Broken #2
function something(value: object | object[]) {
// TODO
}
// Broken #3
function mockFetch(body: ArrayBuffer | Blob | Error | object | string | null = null) {
// TODO
}ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/no-redundant-type-constituents": "error"
},
};tsconfig
Expected Result
All the examples in the repo should be fine, they don't duplicate types
Actual Result
All three examples are broken:
- Example 1 doesn't like
_idreplacing_id? - Example 2 doesn't like union
object | object[](two different types...) - Example 3 doesn't like Error, becaue it's a type of
object, even though the two should be distinct
Additional Info
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a lookWaiting for team members to take a look
{}