Bug: [@typescript-eslint/prefer-optional-chain] why can't report error for "data && data.code === 0" #10938
Closed
4 tasks done
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
triage
Waiting for team members to take a look
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.8.2&fileType=.tsx&code=GYVwdgxgLglg9mABFApgZygCgCYEMq4BciA3hHNisWCALYBGKATgL6IA%2BiNANtwJSkAUIkQxgiHPlyIAZDMR4CAOnKVEAXk2IADAJLCRiJiiggmSYLm5oUAbgNsU1lEMNGTZpFCYg7DwSxAA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Y6RAM0WloHsalfkwCG8WmQAWo5uii9o-aJHBgAviHVA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
ESLint Config
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
The text was updated successfully, but these errors were encountered: