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.
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
[No QA][TS migration] Migrate 'UserUtils.js' lib to TypeScript #27778
[No QA][TS migration] Migrate 'UserUtils.js' lib to TypeScript #27778
Changes from 5 commits
2327a44
adaca7d
04cc1cb
ef5a4e5
c03f7e8
f9ccb69
88bad87
a6f5d24
faf29b7
ff6b622
f5f1d1d
729f5c5
42ae0f5
84175dc
50e1e79
d6b6fe2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the type
loginList: LoginList
correct? if it is, we wouldn't need the question mark inloginList?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's correct, the thing is that this function is still used in some JS files and wrong values are passed and tests were failing. Once we get to these files that use this function the underlying issue will be fixed.
Either way, it's okay to make code safe and use
nullish coalescing
andoptional chaining
even if types says it's not necessary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with this, I expect to be able to trust our types, but I understand that this may be acceptable while in a transitional period
I'm not sure why we didn't prefer
loginList: Login | undefined | null
if we had cases where we are passingundefined
ornull
🤷