prettier v1.19.1 Release Notes

Release Date: 2019-11-09 // 3 months ago
  • diff

    CLI

    🛠 Fix --stdin regression in 1.19.0 (#6894 by @lydell)

    <!-- prettier-ignore -->

    // Prettier stable
    $ echo "test" | prettier --stdin --parser babel
    [error] regeneratorRuntime is not defined
    
    // Prettier master
    $ echo "test" | prettier --stdin --parser babel
    test;
    

    TypeScript

    🛠 Fix formatting of union type as arrow function return type (#6896 by @thorn0)

    <!-- prettier-ignore -->

    // Input
    export const getVehicleDescriptor = async (
      vehicleId: string,
    ): Promise<Collections.Parts.PrintedCircuitBoardAssembly['attributes'] | undefined> => {}
    
    // Prettier stable
    export const getVehicleDescriptor = async (
      vehicleId: string
    ): Promise<| Collections.Parts.PrintedCircuitBoardAssembly["attributes"]
    | undefined> => {};
    
    // Prettier master
    export const getVehicleDescriptor = async (
      vehicleId: string
    ): Promise<
      Collections.Parts.PrintedCircuitBoardAssembly["attributes"] | undefined
    > => {};
    

Previous changes from v1.18.2

  • diff

    • TypeScript: only add trailing commas in tuples for --trailing-comma=all (#6199 by @duailibe)

    In Prettier 1.18 we added trailing commas in tuples when --trailing-comma=all, but it was also adding for --trailing-comma=es5.