Bug: @typescript-eslint/prefer-optional-chain
should be smarter with AND &&
#6435
Closed
4 tasks done
Labels
duplicate
This issue or pull request already exists
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=4.9.3&sourceType=module&code=DYUwLgBAZgliwBMAiIoC4IEMB2BPAUPjFBABQAOmATiNmAPwB02mAtiBAGSf4TRyIUJbr37xkqZmw4i+scUKnsIAQgC8aiAHIA+jrC5ytaVq485AiVCUd1m3ToDOAYwAWIVpi0BKCAG8IAF8gA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Y6RAM0WloHsalfkwCG8WmQAWo5uki9o-aJHBgAviHVA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA
Repro Code
ESLint Config
tsconfig
Expected Result
I expected
fieldDef && fieldDef.name
to replace byfieldDef?.name
Actual Result
no errors
Additional Info
No response
The text was updated successfully, but these errors were encountered: