-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(client-presence): stop fighting noUncheckedIndexAccess (#23592)
1. tsc noUncheckedIndexAccess option does not respect `in` checks, but is safer overall. In those cases, use the more relaxed read and check for `undefined` result (even though `undefined` is not a possible value). - In several places, code blocks are reordered per unicorn/no-negated-condition. 2. Also assignment to a key with subsequent access is not recognized as that key having a value. So, capture the value for subsequent use. 3. Use `!` where type `keyof T` is insufficient as well.
- Loading branch information
Showing
5 changed files
with
40 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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