All Versions
95
Latest Version
Avg Release Cycle
29 days
Latest Release
159 days ago

Changelog History
Page 1

  • v2.2.1 Changes

    November 28, 2020

    diff

    ๐Ÿ›  Fix formatting for AssignmentExpression with ClassExpression (#9741 by @sosukesuzuki)

    <!-- prettier-ignore -->

    // Input
    module.exports = class A extends B {
      method() {
        console.log("foo");
      }
    };
    
    // Prettier 2.2.0
    module.exports = class A extends (
      B
    ) {
      method() {
        console.log("foo");
      }
    };
    
    // Prettier 2.2.1
    module.exports = class A extends B {
      method() {
        console.log("foo");
      }
    };
    
  • v2.2.0 Changes

    November 20, 2020

    2.2.0

    diff

    ๐Ÿš€ ๐Ÿ”— Release Notes

  • v2.1.2 Changes

    September 16, 2020

    diff

    ๐Ÿ›  Fix formatting for directives in fields (#9116 by @sosukesuzuki)

    <!-- prettier-ignore -->

  • v2.1.1 Changes

    August 26, 2020

    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" />
    
  • v2.1.0 Changes

    August 24, 2020

    2.1.0

    diff

    ๐Ÿš€ ๐Ÿ”— Release Notes

  • v2.0.5 Changes

    April 21, 2020

    diff

    Less: Fix formatting of :extend (#7984 by @fisker)

    <!-- prettier-ignore -->

    // Input
    .class {
      &:extend(.some-class .some-other-class .some-very-loooooooooooooong-class all);
    }
    
    // Prettier 2.0.4
    .class {
      &:extend(
        .some-class .some-other-class .some-very-loooooooooooooong-class all
      );
    }
    
    // Prettier 2.0.4 (Second format)
    .class {
      &: extend(
        .some-class .some-other-class .some-very-loooooooooooooong-class all
      );
    }
    
    // Prettier 2.0.5
    .class {
      &:extend(
        .some-class .some-other-class .some-very-loooooooooooooong-class all
      );
    }
    

    ๐Ÿ“ฆ Editor integration: Use resolve if builtin require.resolve is overridden (#8072 by @fisker)

    ๐Ÿ›  This fixes issues that the users of Atom and WebStorm faced with 2.0.4.

    Prettier now switches to using the resolve module for resolving configuration files and plugins if it detects that require.resolve isn't Node's builtin function (doesn't support the second argument), which happens in environments like editor extensions. To force the fallback, set the PRETTIER_FALLBACK_RESOLVE environment variable to true.

  • v2.0.4 Changes

    April 06, 2020

    diff

    โช Revert #7869, "[TypeScript] format TSAsExpression with same logic as BinaryExpression" (#7958)

  • v2.0.3 Changes

    April 05, 2020

    diff

    JavaScript

    ๐Ÿ›  Fix prettier-ignore inside JSX (#7877 by @fisker)

    <!-- prettier-ignore -->

    // Input
    <div>
    {
      /* prettier-ignore */
      x     ?   <Y/> : <Z/>
    }
    </div>;
    
    // Prettier 2.0.2 (first output)
    <div>
      {/* prettier-ignore */
      x     ?   <Y/> : <Z/>}
    </div>;
    
    // Prettier 2.0.2 (second output)
    <div>{/* prettier-ignore */ x     ?   <Y/> : <Z/>}</div>;
    
    // Prettier 2.0.3
    <div>
      {
        /* prettier-ignore */
        x     ?   <Y/> : <Z/>
      }
    </div>;
    

    ๐Ÿ›  Fix regressions in styled-components template literals (#7883 by @thorn0)

    <!-- prettier-ignore -->

    // Input
    const Icon = styled.div`
      background:   var(--${background});
      ${Link}:not(:first-child) {
          fill:    rebeccapurple;
      }
    `;
    
    // Prettier 2.0.2
    const Icon = styled.div`
      background: var(-- ${background});
      ${Link}:not (:first-child) {
        fill: rebeccapurple;
      }
    `;
    
    // Prettier 2.0.3
    const Icon = styled.div`
      background: var(--${background});
      ${Link}:not(:first-child) {
        fill: rebeccapurple;
      }
    `;
    

    ๐Ÿ›  Fix: line endings were not always converted properly in multiline strings and comments (#7891 by @sidharthv96)

    <!-- prettier-ignore -->

    // Input
    export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<CRLF>
      (_0: IAmIncredibleLongParameterType) => {<CRLF>
        setTimeout(() => {<CRLF>
          /*<CRLF>
            Multiline comment<CRLF>
            Multiline comment<CRLF>
            Multiline comment<CRLF>
          */<CRLF>
          console.log(<CRLF>
            "Multiline string\<CRLF>
             Multiline string\<CRLF>
             Multiline string"<CRLF>
          );<CRLF>
        });<CRLF>
      }<CRLF>
    );<CRLF>
    
    // Prettier 2.0.2
    export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<CRLF>
      (_0: IAmIncredibleLongParameterType) => {<CRLF>
        setTimeout(() => {<CRLF>
          /*<LF>
            Multiline comment<LF>
            Multiline comment<LF>
            Multiline comment<LF>
          */<CRLF>
          console.log(<CRLF>
            "Multiline string\<LF>
             Multiline string\<LF>
             Multiline string"<CRLF>
          );<CRLF>
        });<CRLF>
      }<CRLF>
    );<CRLF>
    
    // Prettier 2.0.3: same as input
    

    ๐Ÿ›  Fix bug with holes in array literals (#7911 by @bakkot)

    <!-- prettier-ignore -->

    // Input
    new Test()
      .test()
      .test([, 0])
      .test();
    
    // Prettier 2.0.2
    [error] in.js: TypeError: Cannot read property 'type' of null
    
    // Prettier 2.0.3
    new Test().test().test([, 0]).test();
    

    TypeScript

    Wrap TSAsExpression (#7869 by @sosukesuzuki)

    <!-- prettier-ignore -->

    // Input
    const value = thisIsAnIdentifier as ThisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongInterface;
    
    // Prettier 2.0.2
    const value = thisIsAnIdentifier as ThisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongInterface;
    
    // Prettier 2.0.3
    const value =
      thisIsAnIdentifier as
      ThisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongInterface;
    

    Flow

    <!-- prettier-ignore -->

    // Input
    type Foo = {
      // comment
      ...,
    };
    
    // Prettier 2.0.2
    Error: Comment "comment" was not printed. Please report this error!
    
    // Prettier 2.0.3
    type Foo = {
      // comment
      ...,
    };
    

    Do not add comma for explicit inexact object with indexer property or no properties (#7923 by @DmitryGonchar)

    <!-- prettier-ignore -->

    // Input
    type T = {
      [string]: number,
      ...,
    }
    
    type T = {
      // comment
      ...,
    }
    
    // Prettier 2.0.2
    type T = {
      [string]: number,
      ...,
    }
    
    type T = {
      // comment
      ...,
    }
    
    // Prettier 2.0.3
    type T = {
      [string]: number,
      ...
    }
    
    type T = {
      // comment
      ...
    }
    

    HTML

    ๐Ÿ›  Fix printing of ignored empty inline elements (#7867 by @fisker)

    <!-- prettier-ignore -->

    <!-- Input-->
    <!--prettier-ignore--><span></span>
    <!--prettier-ignore--><span>_</span>
    
    <!-- Prettier 2.0.2 (first output) -->
    <!--prettier-ignore--><span
    ></span>
    <!--prettier-ignore--><span>_</span>
    
    <!-- Prettier 2.0.2 (second output) -->
    <!--prettier-ignore--><span
    
    ></span>
    <!--prettier-ignore--><span>_</span>
    
    <!-- Prettier 2.0.3 -->
    <!--prettier-ignore--><span></span>
    <!--prettier-ignore--><span>_</span>
    

    ๐Ÿ’… Format script and style inside tags with a colon in the name (#7916 by @fisker)

    <!-- prettier-ignore -->

    <!-- Input -->
    <with:colon>
    <script>function foo(){      return 1}</script>
    <style>a         {color:         #f00}</style>
    </with:colon>
    
    <!-- Prettier 2.0.2 -->
    <with:colon>
      <script>
        function foo(){ return 1}
      </script>
      <style>
        a {color: #f00}
      </style>
    </with:colon>
    
    <!-- Prettier 2.0.3 -->
    <with:colon>
      <script>
        function foo() {
          return 1;
        }
      </script>
      <style>
        a {
          color: #f00;
        }
      </style>
    </with:colon>
    

    Other changes

    • โ†ช Workaround for require.resolve in prettier-vscode (#7951 by @thorn0)
    • ๐Ÿ›  Fix unstable Angular expression binding (#7924 by @fisker)
    • โšก๏ธ Update isSCSS regex (#7922 by @fisker)
    • ๐Ÿ›  Fix formatting of empty files (#7921 by @fisker)
  • v2.0.2 Changes

    March 23, 2020
  • v2.0.1 Changes

    March 21, 2020

    diff

    ๐Ÿ— API: Fix build script to not corrupt import-fresh module (#7820 by @thorn0)