Skip to content

[no-unnecessary-type-arguments] fails for CustomEvent #1224

Closed
@andreineculau

Description

@andreineculau

Repro

{
  "rules": {
    "@typescript-eslint/no-unnecessary-type-arguments": ["error"]
  }
}
class FooEvent extends CustomEvent<any> {
}

Expected Result

to pass linting.

Actual Result

Fails linting, because the type CustomEvent<T> has a default type any for the generic T, and thus it wants just CustomEvent.

The problem is that CustomEvent is defined as a global variable, thus the meaning of extends CustomEvent is different than extends CustomEvent<any>.

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 2.7.0
@typescript-eslint/parser 2.7.0
TypeScript 3.7.2
ESLint 6.6.0
node 12.12.0
npm 6.11.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: 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