Skip to content

Optional chaining: (a?.b).c is parsed as a?.b.c #1139

@thorn0

Description

@thorn0

prettier/prettier#6657 is blocked by this issue.

What code were you trying to parse?

(a?.b).c

What did you expect to happen?

The outer node should be of type MemberExpresion, not OptionalMemberExpression.

What actually happened?

Both member expressions are OptionalMemberExpression as if the parens weren't there (a?.b.c).

Versions

package version
@typescript-eslint/typescript-estree 2.5.1-alpha.3
TypeScript 3.7.0-rc
node 10.15.0
npm 6.11.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas prthere is a PR raised to close thispackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy