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 invalid output code when eliding TS star imports #723

Merged
merged 1 commit into from
Jul 14, 2022

Commits on Jul 14, 2022

  1. Fix invalid output code when eliding TS star imports

    From some manual testing, I noticed that the code:
    ```ts
    import A, * as B from "./A";
    console.log(A);
    ```
    becomes this invalid code:
    ```ts
    import A, from "./A";
    console.log(A);
    ```
    The `* as B` was being elided because it's treated as a type-only import, but in
    this case we need to elide the comma as well since there's no concept of
    "trailing commas" here. The code to do that is a little clunky, but I ended up
    always removing the comma and using a boolean to track whether it should be
    added back.
    alangpierce committed Jul 14, 2022
    Configuration menu
    Copy the full SHA
    98ee525 View commit details
    Browse the repository at this point in the history