Skip to main content

Prettier 2.7: new --cache CLI option and TypeScript 4.7 syntax!

· 9 min read

This release includes a new --cache CLI option. Enabling this option will use some attributes as cache keys and format files only if they have changed. This could dramatically improve CLI performance.

We've also added support formatting for TypeScript 4.7 syntax!

If you enjoy Prettier and would like to support our work, consider sponsoring us directly via our OpenCollective or by sponsoring the projects we depend on, including typescript-eslint, remark, and Babel.

Prettier 2.6: new singleAttributePerLine option and new JavaScript features!

· 13 min read

This release includes a new singleAttributePerLine option. This is an option to print only one attribute per line in Vue SFC templates, HTML, and JSX. Per our Option Philosophy, we would prefer not to add such an option. However, there are many users who want this feature, and major style guides like Airbnb’s JavaScript Style Guide and Vue’s style guide recommend the single attribute per line style. A PR to add this feature was opened in October 2019, and both it and the corresponding issue have received a significant amount of support from users. For us it was a hard decision to add this option. We hope the addition of this option will benefit many users without significantly harming our principles.

We've also added support formatting for some new JavaScript syntax proposals via Babel.

Prettier begins paying maintainers

· 2 min read

Prettier, an opinionated code formatter for JavaScript and many web languages, has been accepting donations at OpenCollective since 2019 and thanks to many generous donations we now have $50,000 in the bank! As a result, we are now able to pay the two active maintainers $1,500/month each. This funding will ensure that they will be able to continue consistent maintenance of Prettier into the future.

Prettier 2.4: new bracketSameLine option and TypeScript 4.4 support!

· 4 min read

This release renames the jsxBracketSameLine option to bracketSameLine, which supports HTML, Vue, and Angular in addition to JSX. The old name has been deprecated.

We’ve also added support for TypeScript 4.4, including new syntax features such as class static blocks.

If you enjoy Prettier and would like to support our work, consider sponsoring us directly via our OpenCollective or by sponsoring the projects we depend on, including typescript-eslint, remark, and Babel.

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

· 31 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”

· 36 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.