Packages

prettier

3.10.1 · 12 Nov 2026MIT196.9M / weekRepositoryHomepagenpmAtom feed

Your version

2.1.1

26 Aug 2020Where it was published

2.8.8 is the newest release of 2.x.

Release note

diff

Fix format on html with frontMatter

<!-- 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

// 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"]

<!-- 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

<!-- 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" />

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.