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
@babel/types. Wrong arity while executing callExpression #11169
Comments
Hey @fforres! 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." |
Type builders only have parameters for common/standard attributes. If you need to set more, you can use const expression = Object.assign(t.callExpression(
t.memberExpression(t.identifier("styled"), t.identifier("asd")),
[],
), {
typeArguments: [],
optional: false,
...
}); |
The signature of t.callExpression(callee, arguments) In https://babeljs.io/docs/en/babel-types#callexpression the other properties listed below the signature are not extra arguments, but the shape of the We may need to clarify that in the babel types doc. |
|
It's |
Bug Report
Current Behavior
Been looking into running a code-mod for our codebase.
Our codebase is running Typescript through Babel.
We are looking into extracting some types of some function calls to be reused in other parts of said codemod, but we cannot seem to be able to create a callExpression with more than 2 arguments.
On
@babel/types
it shoes a conflicting doc. https://babeljs.io/docs/en/babel-types#callexpressionInput Code
Expected behavior/code
I can execute t.callExpression to create an expression with types for their arguments or parameters.
https://babeljs.io/docs/en/babel-types#callexpression
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
Added a simple code-sandbox here (I can work on a more complex environment if needed)
Environment
Additional context/Screenshots
Actual error when running our code-mod
The text was updated successfully, but these errors were encountered: