prettier v2.1.1 Release Notes

Release Date: 2020-08-26 // over 3 years ago
  • diff

    ๐Ÿ›  Fix format on html with frontMatter (#9043 by @fisker)

    <!-- prettier-ignore -->

    <!-- Input -->
    ---
    layout: foo
    ---
    
    Test <a
    href="https://prettier.io">abc</a>.
    
    <!-- Prettier stable -->
    TypeError: Cannot read property 'end' of undefined
      ...
    
    <!-- Prettier master -->
    ---
    layout: foo
    ---
    
    Test <a href="https://prettier.io">abc</a>.
    

    ๐Ÿ›  Fix broken format for ...infer T (#9044 by @fisker)

    <!-- prettier-ignore -->

    // Input
    type Tail<T extends any[]> = T extends [infer U, ...infer R] ? R : never;
    
    // Prettier stable
    type Tail<T extends any[]> = T extends [infer U, ...(infer R)] ? R : never;
    
    // Prettier master
    type Tail<T extends any[]> = T extends [infer U, ...infer R] ? R : never;
    

    ๐Ÿ›  Fix format on style[lang="sass"] (#9051 by @fisker)

    <!-- prettier-ignore -->

    <!-- Input -->
    <style lang="sass">
    .hero
      @include background-centered
    </style>
    
    <!-- Prettier stable -->
    <style lang="sass">
    .hero @include background-centered;
    </style>
    
    <!-- Prettier master -->
    <style lang="sass">
      .hero
        @include background-centered
    </style>
    

    ๐Ÿ›  Fix self-closing blocks and blocks with src attribute format (#9052, #9055 by @fisker)

    <!-- prettier-ignore -->

    <!-- Input -->
    <custom lang="markdown" src="./foo.md"></custom>
    <custom lang="markdown" src="./foo.md" />
    <custom lang="markdown" />
    
    <!-- Prettier stable -->
    <custom lang="markdown" src="./foo.md">
    
    </custom>
    <custom lang="markdown" src="./foo.md"
    
    />
    <custom lang="markdown"
    
    />
    
    <!-- Prettier master -->
    <custom lang="markdown" src="./foo.md"></custom>
    <custom lang="markdown" src="./foo.md" />
    <custom lang="markdown" />