You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we use document.querySelector and querySelectorAll I suggest getting the correct element type instead of Element if it starts with a valid HTML tag
Suggestion
π Search Terms
document query selector elements type
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
When we use
document.querySelector
andquerySelectorAll
I suggest getting the correct element type instead ofElement
if it starts with a valid HTML tagπ Motivating Example
The inferred type of
ul
should beHTMLUListElement
instead ofElement
and for
input
it should beHTMLInputElement
notElement
π» Use Cases
With this feature we will not need to write something like this
Note
In some cases, it is obviously an item type, but in other cases cannot be discovered like
querySelector('.menu')
The text was updated successfully, but these errors were encountered: