Meta: Infer better types in querySelector and select-dom#3831
Merged
Meta: Infer better types in querySelector and select-dom#3831
querySelector and select-dom#3831Conversation
sugam74
approved these changes
Dec 22, 2020
65 issues to go
Down to 11 errors!
Member
Author
querySelector typesquerySelector and select-dom
fregante
commented
Dec 29, 2020
| export const getPRHeadRepo = (): ReturnType<typeof getRepo> => { | ||
| return getRepo(select<HTMLAnchorElement>('.commit-ref.head-ref a')!); | ||
| const headLink = select('.commit-ref.head-ref a'); | ||
| return getRepo(headLink); |
Member
Author
There was a problem hiding this comment.
XO was complaining about the ! on GHA, but TypeScript wouldn't accept it without. This way it works for both. Don't ask me why
Member
Author
|
Changes so far have been double-checked and should be correct. |
Member
Author
|
I'll merge this after the next version, so we test out the new changes in |
Member
Heads up you turned off the auto release |
Member
Author
|
Yep, I want v21.1.1 😃 |
Member
|
🎉 Very nice work! |
yakov116
reviewed
Jan 3, 2021
| function init(): void { | ||
| // Use an existing dropdown item to preserve its DOM structure (supports old GHE versions) | ||
| const sourceItem = select<HTMLAnchorElement>([ | ||
| '#filters-select-menu a:nth-last-child(2)', // GHE |
Member
There was a problem hiding this comment.
Looks like this was wrongly labeled ⬆️ works ⬇️ does not
Member
Author
Thank @g-plane! |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Testing out https://github.com/g-plane/typed-query-selector with fregante/select-dom#15, but unfortunately the types currently have some issues.