Rule proposal: prefer querySelector generic vs type cast #9058
Labels
enhancement: new plugin rule
New rule request for eslint-plugin
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
wontfix
This will not be worked on
Before You File a Proposal Please Confirm You Have Done The Following...
My proposal is suitable for this project
Description
#9007 was closed before I could comment there. I wasn't aware that
querySelector
took a generic argument. It'd be nice if there was a lint rule that caughtand recommended changing it to
And maybe this could be done in a more generic way, possibly catching all functions that accept a generic but are being cast instead?
Fail Cases
Pass Cases
Additional Info
It would help with these duplicates if this was enabled in the recommended ruleset
#8388, #7207, #5808, #5359, #528
The text was updated successfully, but these errors were encountered: