Skip to content

Review handling of generically constrained types across rules #1721

Closed
@bradzacher

Description

@bradzacher

@G-Rath noted in #1707 that a generic type is not really that useful, as it does not satisfy things like checker.isArrayType.

We should look to instead using util.getConstrainedTypeAtLocation in our codebase to ensure that we are properly fetching the constrained type from the generic type, instead of using the generic type directly.

I don't know if all rules care about if it's a generic type or not, so it'll take some eyeballing.

Depending on the result of the review, it might make sense to introduce an internal lint rule to help us remember as well.

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