You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Behavior
A @babel/template template with placeholders and a type annotation generates code without the annotation. A template without placeholders works as expected.
Hey @dentrado! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."
The root cause of this bug is that the type annotation is a child node of the identifier. The identifier you are passing to @babel/template doesn't have the type annotation, and thus the one in the template is discarded.
Bug Report
Current Behavior
A
@babel/template
template with placeholders and a type annotation generates code without the annotation. A template without placeholders works as expected.Input Code
Expected behavior/code
I expect both templates above to keep the
: string
type in the generated code.Babel Configuration (.babelrc, package.json, cli command)
No configuration, used from code, see above.
Environment
The text was updated successfully, but these errors were encountered: