Closed as duplicate of#7170
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
function test(data: {code: number} | null) {
if (data && data.code === 0) {
return false;
} else {
return true;
}
}
ESLint Config
{
"rules": {
"@typescript-eslint/prefer-optional-chain": "error"
}
}
tsconfig
Expected Result
show error
Actual Result
why it show ok? I need the rult give some suggrest to optional-chain
Additional Info
No response