WIP '@typescript-eslint/no-unnecessary-condition'#5620
Draft
mstange wants to merge 5 commits intofirefox-devtools:mainfrom
Draft
WIP '@typescript-eslint/no-unnecessary-condition'#5620mstange wants to merge 5 commits intofirefox-devtools:mainfrom
mstange wants to merge 5 commits intofirefox-devtools:mainfrom
Conversation
I'm not really sure why, but without this, TypeScript thinks that the state can only have the values that it sees in the initialization value. It also doesn't complain if setState is called with values that don't match the type it inferred for the state member. It needs to know that this.state can have other values than the initial value if we want to avoid false positives from '@typescript-eslint/no-unnecessary-condition'.
Without these, it thinks that all of the possible keys are present. Fixing this is needed if we want to avoid '@typescript-eslint/no-unnecessary-condition' complaining about our 'prop in obj' tests.
e1439da to
1545249
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5620 +/- ##
==========================================
+ Coverage 85.64% 85.66% +0.01%
==========================================
Files 313 313
Lines 31013 30998 -15
Branches 8535 8525 -10
==========================================
- Hits 26562 26553 -9
+ Misses 4021 4015 -6
Partials 430 430 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
There are type-aware lints we can enable to catch more typescript things. no-unnecessary-condition would catch unnecessary null checks but it's a fair amount of work to get passing. This is some WIP towards that.
I filed microsoft/TypeScript#62468 for the
newSelectedThreadIndexes.sizefalse positive.