Feature request: new value for the preserveParens option
See original GitHub issueWould be good to have a mode in which ParenthesizedExpression
nodes would be created only for parentheses used for JSDoc type assertions.
The syntax of JSDoc type assertions is simple: @type {...}
JSDoc comment followed by a parenthesized expression. Anything else is not a type assertion. Reference: Closure Compiler, TypeScript.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Issues · meriyah/meriyah - GitHub
context masks turns into negative value ... Feature request: new value for the preserveParens option enhancement New ... Feature: syntax check only mode....
Read more >Feature Requests: What are they and how to manage them
These sorts of requests come about when end-users are seeking more value out of your product or have identified a new problem that...
Read more >How To Manage Feature Requests [Template included]
This guide will teach you everything about feature requests – how to process them, manage them, respond to them, prioritize them – so...
Read more >How to say no to product feature requests - Canny Blog
Here's how to say no to feature requests the right way. ... Many companies make it clear that they value user feedback. ......
Read more >10 Tips for Responding Graciously to Customer Feature ...
Do you notice that you get many “bad” satisfaction tickets when customers are requesting product changes or new features? Picture this scenario: A....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, possible. Also they can be nested directly (people really use this):
If you mean ESTree,
ParenthesizedExpression
is not there. It’s a non-standard extension. Overall, ESTree’s approach is to ignore insignificant parentheses. However, the JSDoc convention that uses such parentheses is widespread and important. So from the point of view of tools like formatters and linters, it makes sense to create these non-standard nodes only for JSDoc. In other cases, they only get in the way. E.g. Prettier doesn’t simply print the AST. It also does a lot of checks of the AST structure along the way to choose between different ways to print things. TakingParenthesizedExpression
nodes into account in all those checks would ridiculously complicate them, so actually what happens now in Prettier is an extra step that removes allParenthesizedExpression
s that aren’t JSDoc type assertions from the AST before passing it to printing.I sincerely believe something like
PreserveJsdocParens
would be a slightly better name. 😆I see.