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

Behavior Change: All comments before firstImport are treated as top-of-file #82

Merged
merged 13 commits into from
May 16, 2023

Commits on May 12, 2023

  1. Preserve trailing comments on specifiers (they don't get automaticall…

    …y saved like top-level ones do)
    
    Fixes #79
    fbartho committed May 12, 2023
    Configuration menu
    Copy the full SHA
    ee0bdd0 View commit details
    Browse the repository at this point in the history

Commits on May 14, 2023

  1. Configuration menu
    Copy the full SHA
    1ab1031 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e020081 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1e2ff94 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2023

  1. Preserve trailing comments on specifiers (#80)

    Fixes #79
    
    Trailing comments on specifiers don't get automatically saved like
    top-level ones do. This ensures that such comments are not lost
    
    Before:
    ```ts
    import {
        b2,a2,
        // @ts-expect-error
    } from "b";
    
    import {
        b1,
        a1,
    
        // @ts-expect-error
    } from "a";
    ```
    After
    ```ts
    import {
        a1,
        b1,
        // @ts-expect-error
    } from "a";
    import {
        a2,
        b2,
        // @ts-expect-error
    } from "b";
    ```
    
    ---------
    
    Co-authored-by: Ian VanSchooten <ian.vanschooten@gmail.com>
    fbartho and IanVS committed May 15, 2023
    Configuration menu
    Copy the full SHA
    dbf31ee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0bb7086 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    20a00f2 View commit details
    Browse the repository at this point in the history
  4. Handle type + value importing better

    This treats the first node as the "winner", so that our
    "currentOwnerIsFirstImport" logic works correctly for comments at top of files
    IanVS committed May 15, 2023
    Configuration menu
    Copy the full SHA
    73eec7b View commit details
    Browse the repository at this point in the history
  5. Merge remote-tracking branch 'origin/next' into fb/protect-the-top-of…

    …-file
    
    # Conflicts:
    #	src/utils/get-comment-registry.ts
    IanVS committed May 15, 2023
    Configuration menu
    Copy the full SHA
    5d71054 View commit details
    Browse the repository at this point in the history
  6. Remove .only from tests

    IanVS committed May 15, 2023
    Configuration menu
    Copy the full SHA
    bd07d70 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ddea041 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d9f69fb View commit details
    Browse the repository at this point in the history

Commits on May 16, 2023

  1. Slight reorganization around top-of-file comments (#84)

    I think this makes the code a little easier to follow.
    
    I wasn't able to add an end-to-end integration test around
    "empty-statements-at-top-of-file" because you're right @IanVS, other
    layers prevent that from happening.
    
    Instead I added a unit-test to assert the fatal-errors that we throw.
    fbartho committed May 16, 2023
    Configuration menu
    Copy the full SHA
    e9a9950 View commit details
    Browse the repository at this point in the history