Skip to main content

Prettier 3.7: Improved formatting consistency and new plugin features!

· 28 min read

We are excited to announce Prettier 3.7! This release focuses on polishing the TypeScript and Flow experience, specifically by aligning the formatting of classes and interfaces to be more consistent and predictable. We also want your opinion on the upcoming change to fix inconsistent opening brace print logic of class and interface body.

Additionally, we also fixed lots of bugs, added support for new features in Angular 21 and Graphql 16.12, added Front Matter support to Handlebars.

For plugin developers, we've added new APIs to give you more control over comment attachment and handling of ignored nodes.

If you appreciate Prettier and would like to support our work, please consider sponsoring us directly via our OpenCollective or by sponsoring the projects we depend on. Thank you for your continued support!

Prettier 3.6: Experimental fast CLI and new OXC and Hermes plugins!

· 20 min read

This release includes several important feature additions that we're excited to share with you.

First, we're shipping a new experimental high-performance CLI behind a feature flag (--experimental-cli). This CLI was previously only available in prettier@next, but now you can enable it simply by using a flag. We encourage you to try it out and share your feedback! If you are interested in the internal implementation, please read Prettier's CLI: Performance Deep Dive by Fabio.

Additionally, we're releasing two new official plugins: @prettier/plugin-oxc and @prettier/plugin-hermes. These plugins are provided separately from Prettier's core.

We want to extend our heartfelt gratitude to everyone who made this amazing release possible: @fabiospampinato, @43081j, and @pralkarz along with the new CLI contributors, @boshen and @overlookmotel along with other OXC contributors, the Flow and Hermes teams at Meta. Thank you all for your incredible contributions!

We're excited to see how these new features enhance your development experience. Happy formatting!

Prettier 3.3: New Flow features and a lot of bug fixes

· 7 min read

This release includes support for new Flow features such as component and hook declarations. All of these features were implemented by the engineers on the Flow team, thank you.

If you appreciate Prettier and would like to support our work, please consider sponsoring us directly via our OpenCollective or by sponsoring the projects we depend on, such as typescript-eslint, remark, and Babel. Thank you for your continued support!

Prettier 3.2: Support JSONC and Angular’s ICU expression

· 7 min read

This release includes new features such as adding a JSONC parser, adding Angular’s ICU expressions, and many bug fixes.

We are still seeking feedback for the --experimental-ternaries option released in Prettier 3.1. Please read A curious case of the ternaries and respond via the Google Forms link provided.

Additionally, we recommend reading Prettier's CLI: A Performance Deep Dive by Fabio Spampinato. This faster CLI is slated to be released as version 4.0.

Prettier's CLI: A Performance Deep Dive

· 25 min read

Hey, I'm Fabio and I've been contracted by the Prettier team to speed up Prettier's command line interface (CLI). In this post we'll take a look at the optimizations I've discovered, the process that lead to finding them, some exciting numbers comparing the current CLI with the new one, and some guesses about what could be optimized next.

$20k Bounty was Claimed!

· 4 min read

Prettier, a JavaScript code formatter, has seen an incredible adoption thanks to its careful handling of the very, very, long tail of ways people can write code. At this point, the formatting logic has been solid and after our work on ternaries lands, it will be in a happy state.

This means that we can now focus on the next important aspect: Performance. Prettier has never been fast per se, but fast enough for most use cases. This has always felt unsatisfying so we wanted to do something about it. What better way than a friendly competition.

On November 9th, we put up a $10k bounty for any project written in Rust that would pass 95% of Prettier test suite. Guillermo Rauch, CEO of Vercel, matched it to bring it to $20k and napi.rs added another $2.5k. The folks at Algora even made an amazing landing page for it.

Prettier 3.1: New experimental ternaries formatting and Angular control flow syntax!

· 12 min read

This release adds indentation back to nested ternaries along with a new --experimental-ternaries flag to try a more novel "curious ternary" format that scales better to deeply nested conditionals. We are keen for your feedback on the experimental format before it rolls out as the default behavior later this year!

We have also added support for the control flow syntax in Angular v17. For details on the syntax, please read the official Angular release post.

A curious case of the ternaries

· 6 min read

Ternary formatting has always been a challenge, and we're finally addressing it in v3.1.0 with the introduction of a novel formatting style.

Read on for our journey and the motivation behind this change, along with early developer feedback and an overview of the "curious ternaries" style.

Please give the --experimental-ternaries option a try and let us know what you think!

For a quick tl;dr, see the release post.