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 nullOrObject: null | { a: string };
const test1 = nullOrObject !== undefined && null !== null
? nullOrObject
: 42;
const test2 = nullOrObject !== foo && null !== null
? nullOrObject
: 42;
ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/prefer-nullish-coalescing": "warn"
}
}
tsconfig
Expected Result
I expect neither test should report
Actual Result
both do
Additional Info
Relates to #10724, but this is an existing bug, not a regression from recent work
cc @OlivierZal if you're interested