Skip to content
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

Merged

Commits on Feb 28, 2021

  1. Fix a bug with invalid print output when empty array is passed to t.t…

    …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
    saitonakamura committed Feb 28, 2021
    Copy the full SHA
    775544e View commit details
    Browse the repository at this point in the history