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
[Bug]: TSLiteralType should accept UnaryExpression #13327
Comments
Hey @alexandre-cai! 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." |
Thanks for the bug report!
It can be implemented by replacing https://github.com/babel/babel/blob/main/packages/babel-types/src/definitions/typescript.ts#L342 with a custom validator, similarly to
|
I think |
@nicolo-ribaudo I would love to help in fixing this issue. I am new to this project. Can you guide me a little more on closing this issue? Thanks! |
@Patil2099 You follow these steps: (you need to have
I'm assigning this issue to you; if you need more help feel free to ask! |
Hi 👋 Is this issue always available ? |
@tony-go Let's give @Patil2099 a few more days to work on this. If @Patil2099 doesn't reply within Wednesday, you can work on this. As an alternative, if you prefer I opened #13399. |
Hey @nicolo-ribaudo Yeah for sure ! ✌🏼 |
@Patil2099 Hi! Are you still working on this? |
Is this issue available? I'd like to try this one. |
…ession seems that the generated files is missing typings fix babel#13327
* fix(babel-types): add validator for TSLiteralType to accept UnaryExpression seems that the generated files is missing typings fix #13327 * fix(babel-types): add allowlist for TSLiteralType now generated types seems correct * fix(babel-types): use oneOfNodeTypes instead of oneOf
…13525) * fix(babel-types): add validator for TSLiteralType to accept UnaryExpression seems that the generated files is missing typings fix babel#13327 * fix(babel-types): add allowlist for TSLiteralType now generated types seems correct * fix(babel-types): use oneOfNodeTypes instead of oneOf
💻
How are you using Babel?
Programmatic API (
babel.transform
,babel.parse
)Input code
See REPL: https://runkit.com/alexandre-cai/60a2ae9feaab4400130133c8
Configuration file name
No response
Configuration
No response
Current and expected behavior
Babel currently accepts UnaryExpression while parsing TSLiteralType, but can’t generate one. Output:
Environment
Possible solution
https://github.com/babel/babel/blob/main/packages/babel-types/src/definitions/typescript.ts#L342
Add
UnaryExpression
.Additional context
No response
The text was updated successfully, but these errors were encountered: