-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Uncalled Function Checks don't check negative condition #34815
Comments
✨ This is an old work account. Please reference @brandonchinn178 for all future communication ✨ Very much agree with this. In our code, we just got bit by if (!nock.isActive) {
nock.activate()
} In general, I would usually not intentionally want |
This bit me last week in one of the codebases I maintain. I also see that it's bitten a number of others:
@DanielRosenwasser, would the TS team accept a contribution for this? I've optimistically opened a PR at #57114 |
There are many, many false positives turned up in that PR. Unless these were ~all good finds, I think this is appropriately left still in "awaiting more feedback" state |
The tool for finding false positives is super neat. It makes sense to me to not merge this -- I followed ~20 links and I think this was the only legitimate bug I found (it should have an await). The rest were all just undefined checks on things that the typings say should always be defined. I'm happy to close out that PR (or have you close it). Whatever works for you. |
Expected: Error on
!foo
that the condition is always true becausefoo
is defined.Actual: No error.
Also, any work on this should include the following test:
The text was updated successfully, but these errors were encountered: