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
Hey @gdbd! 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.
gdbd
changed the title
[Bug]: TypeScript parser does not set typeParameters for json { parserOpts: { plugins: ["typescript"] }, plugins: ["@babel/plugin-transform-typescript"], ast: true, }
[Bug]: TypeScript parser does not set typeParameters for CallExpression
Mar 28, 2024
Please remove the typescript transform if you are to inspect the AST, since the transform plugin will remove any typescript type annotations, while the syntax plugin is to only parse but not transform the typescript.
馃捇
How are you using Babel?
Programmatic API (
babel.transform
,babel.parse
)Input code
Configuration file name
No response
Configuration
Current and expected behavior
expected:
result.ast.program.body[0].expression.typeParameters !== null
actual:
result.ast.program.body[0].expression.typeParameters === null
Environment
Possible solution
No response
Additional context
reproduce repository: https://github.com/gdbd/babel-test
to start:
yarn install
look in the output:
at step 3:
at step 4:
So,
typeParameters
is not avalibale directly viaCallExpression
but availbale whwn it accesses through it parents.Same time, AST explorer works as expected:
The text was updated successfully, but these errors were encountered: