Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review handling of generically constrained types across rules #1721

Closed
bradzacher opened this issue Mar 12, 2020 · 1 comment
Closed

Review handling of generically constrained types across rules #1721

bradzacher opened this issue Mar 12, 2020 · 1 comment
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

Comments

@bradzacher
Copy link
Member

@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.

@bradzacher bradzacher added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin labels Mar 12, 2020
@JoshuaKGoldberg JoshuaKGoldberg added the accepting prs Go ahead, send a pull request that resolves this issue label Oct 25, 2021
@JoshuaKGoldberg
Copy link
Member

Since this issue I think we've had a handful of reports that were solved by util.getConstrainedTypeAtLocation. Closing to trim out the issue queue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

2 participants