Zum Inhalt springen

Prettier Release Notes

Einträge
21
Quellen
1
Zuletzt aktualisiert

Folge Prettier, um die Release Notes in deinen Feed zu holen.

Prettier

Prettier 3.10: New Flow syntax, new JavaScript syntax, and new plugin powered by Yuku

We're excited to announce Prettier 3.10!

This release adds support for new Flow syntax and the latest JavaScript proposals, and introduces a new official plugin — @prettier/plugin-yuku — powered by the high-performance Yuku toolchain, with dedicated JavaScript and TypeScript parsers.

It also includes a wide range of fixes and improvements across JavaScript, TypeScript, Markdown, HTML, and more.

If you find Prettier valuable, please consider sponsoring us on OpenCollective or supporting the upstream projects we rely on. Your contributions help us keep improving the tool for everyone.

Thank you for your continued support! ❤️

Highlights​

JavaScript​

Added a new official plugin @prettier/plugin-yuku (#19628, #19629 by @fisker)​

@prettier/plugin-yuku is powered by Yuku (A high-performance JavaScript/TypeScript compiler toolchain written in Zig). …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 3.9 mit Parser-Upgrades

Prettier 3.9 bringt größere Parser-Upgrades für Markdown, YAML, Flow, GraphQL und Angular sowie Formatierungsverbesserungen für JavaScript und TypeScript.

We are excited to announce Prettier 3.9!

This release brings major parser upgrades for Markdown, YAML, Flow, GraphQL, and Angular, along with formatting improvements for JavaScript and TypeScript (particularly in --no-semi mode).

If you find Prettier valuable, please consider sponsoring us on OpenCollective or supporting the upstream projects we rely on. Your contributions help us keep improving the tool for everyone.

Thank you for your continued support! ❤️

A reminder, when Prettier is installed or updated, it’s strongly recommended to specify the exact version in package.json: "prettier": "3.9.0", not "prettier": "^3.9.0".

If you use @prettier/plugin-oxc or @prettier/plugin-hermes, don't forget to upgrade them to ensure the new formatting rules are applied.

Highlights​

Markdown​

Upgrade parser to latest micromark (#18277 by @seiyab, @j-f1, @fisker)​ …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 3.8 mit Angular-v21.1-Support

Prettier 3.8 unterstützt die neuen Angular-v21.1-Funktionen wie aufeinanderfolgende @case-Anweisungen und Spread-Elemente in Templates.

We're excited to announce that Prettier now fully supports the fresh features landing in Angular v21.1 (released today 🎉)!

This update brings cleaner, more expressive templates with:

  • Consecutive @case statements in @switch blocks.
  • Spread elements (...) in array literals, object literals, and function calls inside templates.

We've also added the ability to format Angular syntax beautifully inside Markdown code blocks.

If you find Prettier valuable and want to help us keep pace with fast-moving frameworks like Angular, please consider sponsoring us on OpenCollective or supporting the projects we rely on. Thank you for being part of this community — your support means a lot!

Highlights​

Angular​

Support for consecutive switch cases (#18593 by @fisker)​

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 3.7 für konsistentere Formatierung

Prettier 3.7 verbessert die Formatierungskonsistenz bei TypeScript und Flow, behebt Fehler und fügt neue APIs für Plugin-Entwickler hinzu.

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!

Highlights​

TypeScript​

Fix the inconsistent printing between class and interface (#18094, #18091, #18215 by @fisker)​ …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 3.6: Experimentelle CLI und neue Plugins

Prettier 3.6 führt eine experimentelle schnelle CLI mit dem Flag --experimental-cli sowie die neuen offiziellen Plugins für OXC und Hermes ein.

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

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 3.5: Neue Optionen und TS-Konfiguration

Prettier 3.5 fügt die Optionen objectWrap und experimentalOperatorPosition sowie die Unterstützung für TypeScript-Konfigurationsdateien hinzu.

This release includes a lot of bug fixes and the following new features:

  • Support for the new objectWrap option
  • Support for the new experimental experimentalOperatorPosition option
  • Support for TypeScript configuration file

See each section for details.

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!

Why We Added Two New Options​

This release introduces two new options. If you’re familiar with Prettier’s Option Philosophy, you might be wondering: “Why add new options?” Rest assured, these aren’t your typical options, nor do they violate our option philosophy. …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 3.4: Viele Fehlerbehebungen

Prettier 3.4 enthält zahlreiche Fehlerbehebungen und Verbesserungen, darunter eine Korrektur bei der Formatierung von Template-Literalen mit Arrays.

This release includes numerous bug fixes and other improvements.

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!

Other Changes​

JavaScript​

Fix template literal print with array (#13315 by @fisker, @syi0808)​

// Inputconst string = `${[[1, 2], [3, 4]]}`// Prettier 3.3const string = `${[  [2],  [4],]}`;// Prettier 3.4const string = `${[  [1, 2],  [3, 4],]}`;
``` …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 3.3: Neue Flow-Features und Fehlerbehebungen

Prettier 3.3 unterstützt neue Flow-Features wie Komponenten- und Hook-Deklarationen sowie die Ausgabe von declare-namespace-Blöcken.

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!

Highlights​

Flow​

declare namespace printing support (#16066 by @SamChou19815)​

// Inputdeclare namespace foo {  declare var bar: string;}// Prettier 3.2// does not parse// Prettier 3.3declare namespace foo {  declare var bar: string;}
``` …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 3.2: JSONC-Parser und Angular-ICU-Ausdrücke

Prettier 3.2 erweitert die Unterstützung um einen JSONC-Parser und Angular-ICU-Ausdrücke sowie viele Fehlerbehebungen.

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.

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!

Highlights​

JSON​

New jsonc parser added (#15831 by @fisker)​ …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier CLI Performance Deep Dive

Ein Blogbeitrag beschreibt die Optimierungen der neuen Prettier-CLI, die über prettier@next installiert werden kann und weitgehend abwärtskompatibel ist.

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.

Installation​

The new work-in-progress CLI for Prettier has just been released, and you can install it now:

npm install prettier@next

It should be largely backwards compatible:

prettier . --check # Like before, but faster

If you find any issues you can temporarily use the old CLI using an environment variable:

PRETTIER_LEGACY_CLI=1 prettier . --check

You can also try it via npx, though npx itself is pretty slow:

npx prettier@next . --check

The goal is to make it close to ~100% backwards compatible, and then just ship it in a future stable release of the prettier package, replacing the current CLI.

Overview​

Prettier's CLI works roughly like in the diagram above: …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

20.000-Dollar-Bounty beansprucht

Ein Preisgeld von 20.000 Dollar für ein Rust-Projekt, das 95% der Prettier-Tests besteht, wurde von einem Projekt beansprucht.

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.

Winner Winner Chicken Dinner​ …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 3.1: Experimentelle Ternaries und Angular-Syntax

Prettier 3.1 führt ein experimentelles Format für Ternaries mit dem Flag --experimental-ternaries ein und unterstützt die Angular-v17-Kontrollflusssyntax.

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.

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!

Highlights​

JavaScript​ …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Die seltsame Welt der Ternaries

Der Beitrag erklärt das neue experimentelle Format für Ternaries in Prettier 3.1 und bittet um Rückmeldungen zur Option --experimental-ternaries.

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.

Introduction​

Formatting nested ternaries nicely in a wide variety of scenarios is a surprisingly tricky challenge.

Developers have long found them so confusing to read that they end up just refactoring their code to an ugly series of if-else statements, often with a let declaration, an iife, or a separate function entirely.

According to beta testers, the new formatting style we've developed can take some getting used to, but ultimately allows ternaries to be practically used as a concise form of if-else-expressions in modern codebases.

Historical background​ …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 3.0: ECMAScript-Module

Prettier 3.0 migriert auf ECMAScript-Module, bringt Formatierungsänderungen und Breaks sowie eine überarbeitete Plugin-Schnittstelle mit.

We are excited to announce the release of the new version of Prettier!

We have made the migration to using ECMAScript Modules for all our source code. This change has significantly improved the development experience for the Prettier team. Please rest assured that when using Prettier as a library, you can still use it as CommonJS as well.

This update comes with several breaking changes. One notable example is the alteration in markdown formatting - spaces are no longer inserted between Latin characters and Chinese or Japanese characters. We'd like to extend our gratitude to Tatsunori Uchino, who has made significant contributions to Prettier over the past year, particularly with this feature. Additionally, the default value of trailingComma has been changed to "all".

Another important change in this release is the significant overhaul of the plugin interface. Prettier now supports plugins written using ECMAScript Modules and async parsers. If you're a plugin developer, please exercise caution while updating. You can find the migration guide here. As always, we welcome bug reports and feedback!

This release also includes numerous formatting improvements and bug fixes. …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 2.8: verbesserte --cache-Option und TypeScript 4.9

Prettier 2.8 verbessert die --cache-Option um --cache-location und behebt einen Fehler beim Speichern des Caches, außerdem wird der TypeScript-4.9-satisfies-Operator unterstützt.

This release includes improvements to the --cache option added in 2.7. A new --cache-location option has been added, and a bug that saved the cache even when --write wasn't specified has been fixed.

We're also adding support for TypeScript 4.9 satisfies operator!

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.

The Prettier team plans to release 3.0 within the next few months. If you are a plugin developer, get ready for the migration. Visit the migration guide and issue #13606 for more information.

Highlights​

TypeScript​ …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 2.7: neue --cache-Option und TypeScript 4.7

Prettier 2.7 führt die neue --cache-CLI-Option ein, die nur geänderte Dateien formatiert, und unterstützt die TypeScript-4.7-Syntax.

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.

Highlights​

TypeScript​

Support TypeScript 4.7 (#12896, #12897, #12898, #12900, #12921, #12924, #12959 by @sosukesuzuki)[​](https://prettier.io/blog/2022/06/14/2.7.0#support-typescript-47-12896-12897-12898-12900-12921-12924-12959-by-sosukesuzuki "Direct link to support-typescript-47-12896-1…

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 2.6: neue singleAttributePerLine-Option

Prettier 2.6 fügt die neue Option singleAttributePerLine hinzu, die pro Zeile nur ein Attribut in Vue, HTML und JSX ausgibt, und unterstützt neue JavaScript-Syntax.

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.

Thanks to our sponsors​ …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier zahlt Maintainern Gehalt

Prettier zahlt dank Spenden nun den beiden aktiven Maintainern monatlich jeweils 1.500 Dollar für ihre kontinuierliche Arbeit am Projekt.

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.

Open Source and Money has always been a tricky topic. We've tried many things with Prettier. Right after the project was open sourced, Facebook contracted James Long for 2 weeks in order to polish it. Facebook also paid Christopher Chedeau (vjeux) for 9 months to work on it full time. Once there was $10,000 in contributions, we gave everyone that contributed significantly the opportunity to redeem $1,000 but due to the complexities in collecting the money, few people did.

We now have $50,000 which is a sizable sum but not enough for someone with the skills to work on it to do it full time. But at the same time we shouldn't let it sit unused. So after a lot of thinking, we decided to provide a recurring $1,500 to the two current maintainers of the project. They have been amazing stewards for the project for the past 2 years!

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 2.5: TypeScript 4.5 und MDX v2 Kommentare

Prettier 2.5 unterstützt die neue TypeScript-4.5-Syntax und die Kommentarsyntax von MDX v2.

This release adds support for TypeScript 4.5's new syntax and MDX v2 comment 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.

Highlights​

TypeScript​

Avoid extra offset in arrow function body when using long types (#11515 by @kachkaev and @thorn0)​

Starting with Prettier 2.3.0, type declarations in arrow functions could affect function body indentation. Changing the length of the type annotation could produce large diffs and thus increased the chance of git conflicts. To prevent this, function body offset was stabilized. …

Originalquelle(öffnet in neuem Tab)Problem melden

Prettier

Prettier 2.4: bracketSameLine und TypeScript 4.4

Prettier 2.4 benennt die Option jsxBracketSameLine in bracketSameLine um und unterstützt TypeScript 4.4 sowie class static blocks.

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.

Highlights​

TypeScript​

Support TypeScript 4.4 (#11426 by @sosukesuzuki)​

Support TypeScript 4.4! …

Originalquelle(öffnet in neuem Tab)Problem melden