-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
ASTPRs and Issues about the AST structurePRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuepackage: typescript-estreeIssues related to @typescript-eslint/typescript-estreeIssues related to @typescript-eslint/typescript-estree
Description
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
FuPeiJiang, DetachHead, KotlinIsland, cedx, kirkwaiblinger and 3 more
Metadata
Metadata
Assignees
Labels
ASTPRs and Issues about the AST structurePRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuepackage: typescript-estreeIssues related to @typescript-eslint/typescript-estreeIssues related to @typescript-eslint/typescript-estree