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 a bug with invalid print output when empty array is passed to t.tsInterfaceDeclaration #12921
Fix a bug with invalid print output when empty array is passed to t.tsInterfaceDeclaration #12921
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/43107/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 775544e:
|
8bd104f
to
92d12b8
Compare
Could you add a test in https://github.com/babel/babel/blob/main/packages/babel-generator/test/index.js? 🙏 |
…sInterfaceDeclaration If you pass an empty array as `extends` in `t.tsInterfaceDeclaration` you'll get an invalid code printed ```ts t.tsInterfaceDeclaration( t.identifier('x'), undefined, [], t.tsInterfaceBody([]) ) ``` You will get ```ts interface A extends {} ``` Which is an invalid TS, this PR fixes that
92d12b8
to
775544e
Compare
Ya, totally, hope it's in the right place 😄 |
Fix a bug with invalid print output when empty array is passed to t.tsInterfaceDeclaration
If you pass an empty array as
extends
int.tsInterfaceDeclaration
you'll get an invalid code printedYou will get
Which is an invalid TS, this PR fixes that