Review handling of generically constrained types across rules #1721
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
@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.
The text was updated successfully, but these errors were encountered: