Skip to content

[no-unnecessary-type-arguments] Flags a violation for identically-named but different types #4489

Closed
@NickHeiner

Description

@NickHeiner
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

Playground

type DefaultE = {foo: string};
type T<E = DefaultE> = {box: E};

type G = T<DefaultE>;

declare module 'bar' {
    type DefaultE = {somethingElse: true};
    // This is flagged as an error. The name `DefaultE` is the same, but the type is different.
    type G = T<DefaultE>;
}

Expected Result
The rule only flags violations when the type argument is identical to the default.

Actual Result
The rule flags violations when the type argument is different from the default, but has the same name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions