-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(ecma_parser) Allow arrow func without parenthesisised param in conditional for TS #4138
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
fix(ecma_parser) Allow arrow func without parenthesisised param in conditional for TS #4138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
swc-bump:
- swc_ecma_parser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automated review comment generated by auto-rebase script
Thanks for fixing this, @williamtetlow! |
FYI, we just reverted microsoft/TypeScript#47550 for TS 4.7 (in microsoft/TypeScript#48940), as it caused some unexpected breaks (with plans to solve it for real in 4.8). So, you my want to back this one out. |
Ah yep we had the same bug 😆 we've fixed that case and one other on our side and haven't seen any other issues come in @kdy1 I'll let you decide whether we pull this or leave it in seeing as it will be released in 4.8? |
I think it's better to revert this and #4302 for now |
Cool I can submit PR later today |
Thank you! I was busy due to the new minifier rule :) |
Description:
Fixes #2174, #4067
In #3685 (comment) we removed TS support for arrow function without parenthesis on single param to match the behaviour of TSC.
As of microsoft/TypeScript#47550 TSC supports this syntax.
This PR adds support for syntax.
BREAKING CHANGE:
Related issue (if exists):