Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix typing in asyncDataTree.test.ts#209394

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
joaomoreno merged 11 commits intomicrosoft:mainfroma-stewart:async-data-tree-typing
Jul 2, 2025

Conversation

a-stewart
Copy link
Contributor

InasyncDataTree.test.ts we callcontainer.querySelector which returnsElement | null, and we cast this toHTMLElement | undefined and then do an equality check against undefined.

Whilst this works sincenull == undefined, the typing does make it slightly unclear what we actually have here, and when running with our stricted test setup, the test actually fails.

There is no technical reason to accept this PR, but casting toHTMLElement | null is slightly more correct and may avoid issues in the future if you ever want to to do other checks, egchild !== undefined would always be true which could potentially hide issues.

@jriekenjrieken assignedjoaomoreno and unassignedjriekenApr 3, 2024
@a-stewarta-stewart marked this pull request as ready for reviewApril 4, 2024 00:15
@a-stewart
Copy link
ContributorAuthor

Small ping@joaomoreno

@joaomoreno
Copy link
Member

Why not simply removing the type casts? The compiler should be happy by now.

@a-stewart
Copy link
ContributorAuthor

@joaomoreno :
Why not simply removing the type casts? The compiler should be happy by now.

Done

@a-stewart
Copy link
ContributorAuthor

@joaomoreno - could this be merged please - I think it needs reapproval after making your suggested changes

@joaomoreno
Copy link
Member

Thanks! 🍻

@joaomorenojoaomorenoenabled auto-merge (squash)June 26, 2025 07:47
@vs-code-engineeringvs-code-engineeringbot added this to theJune 2025 milestoneJun 26, 2025
@DoiDoi888
Copy link

InasyncDataTree.test.ts we callcontainer.querySelector which returnsElement | null, and we cast this toHTMLElement | undefined and then do an equality check against undefined.

Whilst this works sincenull == undefined, the typing does make it slightly unclear what we actually have here, and when running with our stricted test setup, the test actually fails.

There is no technical reason to accept this PR, but casting toHTMLElement | null is slightly more correct and may avoid issues in the future if you ever want to to do other checks, egchild !== undefined would always be true which could potentially hide issues.

https://skynet.certik.com/zh-CN/projects/uniswap?utm_source=okx#vote

@a-stewart
Copy link
ContributorAuthor

a-stewart commentedJul 1, 2025
edited
Loading

@hediet@joaomoreno - I don't think I have permissions to merge this myself - you have approved but I think one of you need to press the button to merge it in.

@joaomorenojoaomoreno merged commite73a19b intomicrosoft:mainJul 2, 2025
7 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@joaomorenojoaomorenojoaomoreno approved these changes

@hediethediethediet approved these changes

Assignees

@joaomorenojoaomoreno

Labels
None yet
Projects
None yet
Milestone
June 2025
Development

Successfully merging this pull request may close these issues.

5 participants
@a-stewart@joaomoreno@DoiDoi888@hediet@jrieken

[8]ページ先頭

©2009-2025 Movatter.jp