New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: new value for the preserveParens option #183
Comments
This is probably difficult for meriyah, as the content of comment needs to go through some kind of syntax parsing too. |
The syntax is super simple. See the links. No need to parse the type itself. Just the fact that the comment starts with |
I see. |
@KFlash can you have a look? I am not sure how to temporarily turn on Context.OptionsPreserveParens if next token is I am not sure if recursive type casting is possible. @thorn0 ? /** @type xxx */ ({a: /** @type xxx */ (b) }) Right now, I guess you are turning on preserveParens option globally. |
Can't you just create a new option? Name it
@thorn What's the use case for this? And why do you want to turn off |
Yes, possible. Also they can be nested directly (people really use this): /** @type MyType */ (/** @type any */ (x))
If you mean ESTree,
I sincerely believe something like |
Would 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.The text was updated successfully, but these errors were encountered: