-
-
Notifications
You must be signed in to change notification settings - Fork 827
Conform more of the codebase to strictNullChecks + noImplicitAny #11179
Conversation
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.
Approving and happy for it to be merged once the snap comment has been addressed 👍
Exciting to have almost all strict errors fixed 👏
if (!lookup || !lookup.mxid) { | ||
if (!lookup || !("mxid" in lookup)) { |
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'm sure this is valid, but i'm not sure i understand what rule it's conforming to?
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.
Its because the return type is {} | { mxid: string; ... }
so to make TS happy we can't just do !lookup.mxid
as {}.mxid
is invalid. So we have to use in
for narrowing
This invite to RoomPreviewBar-test-room was sent to test@test.com | ||
Do you want to join RoomPreviewBar-test-room? |
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.
Are we expecting this change in the snapshot? It looks like what it prints does not match the test name anymore, could we update it?
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 does actually match, it was wrong before. The test name is renders invite message when invite email mxid match
yet it was the same snapshot as renders email mismatch message when invite email mxid *doesnt* match
. When the email matches it should be treated as a normal invite, removing the complexity of email invites.
… t3chguy/types/3jul23
Requires matrix-org/matrix-js-sdk#3537
This change is marked as an internal change (Task), so will not be included in the changelog.