Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
declareconsta:string|null;declareconstb:string|null;declarefunctionf(x:unknown):unknown;// correctly reportsf(a||b);// should but doesn't reportif(f(a||b)){}
ESLint Config
module.exports={"rules":{"@typescript-eslint/prefer-nullish-coalescing":["warn",{"ignoreConditionalTests":true}]}}
tsconfig
{"compilerOptions": {"strictNullChecks":true }}
Expected Result
I expect thatif (f(a || b)) {}
should report, sincea || b
is being used as a function argument, not the test of anif
statement.
Actual Result
it doesn't report
Additional Info
Just popping this up as a standalone issue for visibility/tracking. It will likely be addressed in#9924 (comment)