prettier v2.5.1 Release Notes

  • diff

    👌 Improve formatting for empty tuple types (#11884 by @sosukesuzuki)

    <!-- prettier-ignore -->

    // Input
    type Foo =
      Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo extends []
        ? Foo3
        : Foo4;
    
    // Prettier 2.5.0
    type Foo = Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo extends [
    
    ]
      ? Foo3
      : Foo4;
    
    // Prettier 2.5.0 (tailingCommma = all)
    // Invalid TypeScript code
    type Foo = Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo extends [
      ,
    ]
      ? Foo3
      : Foo4;
    
    // Prettier 2.5.1
    type Foo =
      Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo extends []
        ? Foo3
        : Foo4;
    
    

    🛠 Fix compatibility with Jest inline snapshot test (#11892 by @fisker)

    ✅ A internal change in [email protected] accidentally breaks the Jest inline snapshot test.

    👌 Support Glimmer's named blocks (#11899 by @duailibe)

    👍 Prettier already supported this feature, but it converted empty named blocks to self-closing, which is not supported by the Glimmer compiler.

    👀 See: Glimmer's named blocks.

    <!-- prettier-ignore -->

    // Input
    <Component>
      <:named></:named>
    </Component>
    
    // Prettier 2.5.0
    <Component>
      <:named />
    </Component>
    
    // Prettier 2.5.1
    <Component>
      <:named></:named>
    </Component>