Skip to main content

Prettier 2.3. In which assignments are consistent, short keys non-breaking, and Handlebars official

· 32 min read

This release focuses on fixing long-standing issues in the JavaScript printer. Be warned that, unfortunately, reformatting a project with the new version might result in quite a big diff. If you don’t use ignoreRevsFile to hide such wholesale changes from git blame, it might be about time.

A remarkable milestone is the long-awaited release of the Ember / Handlebars formatter. It’s supposed to be the last formatter included directly in the core library. In the future, for sustainability, languages should be added only by plugins.

We are grateful to our financial contributors: Salesforce, Indeed, Frontend Masters, Airbnb, Shogun Labs, Skyscanner, Konstantin Pschera, and many others who help us keep going. If you enjoy Prettier and would like to support our work, head to our OpenCollective. Please consider also supporting the projects Prettier depends on, such as typescript-eslint, remark, and Babel.

Most of the changes in this release are thanks to the hard work of Fisker Cheung, Georgii Dolzhykov, and Sosuke Suzuki, along with many other contributors.

And just a reminder, when Prettier is installed or updated, it’s strongly recommended to specify the exact version in package.json: "2.3.0", not "^2.3.0".

Prettier 2.0 “2020”

· 37 min read

Better defaults, a better CLI and better heuristics. Oh, and TypeScript 3.8.

After a long and careful consideration, we decided to change the default values for the trailingComma, arrowParens, and endOfLine options. We made the CLI more intuitive. And we've finally dropped support for Node versions older than 10, which had grown to become a huge maintenance hassle and an obstacle for contributors. Read below in details.

Prettier 1.15: HTML, Vue, Angular and MDX Support

· 31 min read

This release adds support for HTML, Vue, Angular and MDX. It also respects decorator position, adds an option for JSX single quotes, allows parser inference via shebang, adds support for several new syntax features, and has a few formatting tweaks.