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 have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
declare const a: string | null;
declare const b: string | null;
declare function f(x: unknown): unknown;
// correctly reports
f(a || b);
// should but doesn't report
if (f(a || b)) {}
ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/prefer-nullish-coalescing": [
"warn",
{
"ignoreConditionalTests": true
}
]
}
}
tsconfig
Expected Result
I expect that if (f(a || b)) {}
should report, since a || b
is being used as a function argument, not the test of an if
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)