Skip to content

Conversation

@mstange
Copy link
Contributor

@mstange mstange commented Sep 19, 2025

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.size false positive.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant