Skip to content

Support for JSDoc type assertions #1682

Open
@thorn0

Description

@thorn0

What code were you trying to parse?

/** @type {Date} */ (expr)

What did you expect to happen?

There are cases when AST consumers need to know whether an expression had parens. Babel adds .extra.parenthesized: true to nodes. My proposal is to do the same thing. For example, this feature would be useful for Prettier to format Closure-style type casts properly.

What actually happened?

The parser ignores parens when building the AST.

Versions

not relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuepackage: 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