Bug: prefer-optional-chain throws error: "Unexpected member object type: TSAsExpression" #6068
Closed
4 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
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=JYOwLgpgTgZghgYwgAgCoHsDWETIN4BQyymoAJgPwBcyAzmFKAOYDcBAvgTAK4gJjB0uenChhaqOEwAUYLDhoZsIAJQ0ARunQAbCHFyFiUCGG5RcAQgvSixZNbnLkcWs5ABPFQDpSIMsgAfAPsAbQAiMnR+dwAHCDCAGmQwgA8AW20wgF0vUARtbjIIWmlZeVwXN08fchVbFTZOAggUmPQxZCL4bm0wOjBRcUlWAiA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Y6RAM0WloHsalfkwCG8WmQAWo5uii9o-aJHBgAviHVA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA
Repro Code
for reference, the full source is here
tsconfig
Expected Result
Expected ESLint not to throw
Actual Result
In VSCode ESLint throws with a message "Unexpected member object type: TSAsExpression":
The playground error is more cryptic:
Additional Info
I suspect it's from v5.44 release, and it might be a similar-class bug to #5553
Versions
@typescript-eslint/eslint-plugin
^5.44.0
@typescript-eslint/parser
^5.44.0
TypeScript
^4.8.4
ESLint
^8.28.0
node
16.14.2
The text was updated successfully, but these errors were encountered: