Prettier Blog

https://prettier.io/blog

Opinionated Code Formatter

フィード

記事のアイキャッチ画像
Prettier 3.2: Support JSONC and Angular’s ICU expression
Prettier Blog
<p>This release includes new features such as adding a JSONC parser, adding Angular’s ICU expressions, and many bug fixes.</p><p>We are still seeking feedback for the <code>--experimental-ternaries</code> option released in Prettier 3.1. Please read <a href="https://prettier.io/blog/2023/11/13/curious-ternaries">A curious case of the ternaries</a> and respond via the Google Forms link provided.</p><p>Additionally, we recommend reading <a href="https://prettier.io/blog/2023/11/30/cli-deep-dive">Prettier's CLI: A Performance Deep Dive</a> by <a href="https://github.com/fabiospampinato">Fabio Spampinato</a>. This faster CLI is slated to be released as version 4.0.</p>
4ヶ月前
記事のアイキャッチ画像
Prettier's CLI: A Performance Deep Dive
Prettier Blog
<p>Hey, I'm <a href="https://twitter.com/fabiospampinato">Fabio</a> 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.</p>
6ヶ月前
記事のアイキャッチ画像
$20k Bounty was Claimed!
Prettier Blog
<p>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 <a href="https://prettier.io/blog/2023/11/13/curious-ternaries">ternaries</a> lands, it will be in a happy state.</p><p>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.</p><p>On November 9th, we put up a <a href="https://twitter.com/Vjeux/status/1722733472522142022">$10k bounty</a> 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 <a href="https://napi.rs">napi.rs</a> added another $2.5k. The folks at Algora even made an amazing landing page for i
6ヶ月前
記事のアイキャッチ画像
A curious case of the ternaries
Prettier Blog
<p>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.</p><p>Read on for our journey and the motivation behind this change, along with early developer feedback and an overview of the &quot;curious ternaries&quot; style.</p><p>Please give the <code>--experimental-ternaries</code> option a try and let us know what you think!</p><p><em>For a quick tl;dr, <a href="/blog/2023/11/13/3.1.0">see the release post</a>.</em></p>
6ヶ月前
記事のアイキャッチ画像
Prettier 3.1: New experimental ternaries formatting and Angular control flow syntax!
Prettier Blog
<p>This release adds indentation back to nested ternaries along with a new <code>--experimental-ternaries</code> flag to try a more novel &quot;curious ternary&quot; format that scales better to deeply nested conditionals. We are keen for <a href="https://forms.gle/vwEuboCobTVhEkt66">your feedback</a> on the experimental format before it rolls out as the default behavior later this year!</p><p>We have also added support for the control flow syntax in Angular v17. For details on the syntax, please read <a href="https://blog.angular.io/introducing-angular-v17-4d7033312e4b">the official Angular release post</a>.</p>
6ヶ月前
記事のアイキャッチ画像
Prettier 3.0: Hello, ECMAScript Modules!
Prettier Blog
<p>We are excited to announce the release of the new version of Prettier!</p><p>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.</p><p>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 <a href="https://github.com/tats-u">Tatsunori Uchino</a>, who has made significant contributions to Prettier over the past year, particularly with this feature. Additionally, the default value of <code>trailingComma</code> has been changed to <code>&quot;all&quot;</code>.</p><p>Another important change in this release is the significant overhaul of the plugin interface. Prettier now supports plugins w
1年前
記事のアイキャッチ画像
Prettier 2.8: improve --cache CLI option and TypeScript 4.9 satisfies operator!
Prettier Blog
<p>This release includes improvements to the <code>--cache</code> option added in 2.7. A new <code>--cache-location</code> option has been added, and a bug that saved the cache even when <code>--write</code> wasn't specified has been fixed.</p><p>We're also adding support for TypeScript 4.9 <code>satisfies</code> operator!</p><p>If you enjoy Prettier and would like to support our work, consider sponsoring us directly via <a href="https://opencollective.com/prettier">our OpenCollective</a> or by sponsoring the projects we depend on, including <a href="https://opencollective.com/typescript-eslint">typescript-eslint</a>, <a href="https://opencollective.com/unified">remark</a>, and <a href="https://opencollective.com/babel">Babel</a>.</p><p>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 <a href="https://github.com/prettier/prettier/wiki/How-to-migrate-my-plugin-to-support-Prettier-v3%3F">the migration gui
1年前
記事のアイキャッチ画像
Prettier 2.7: new --cache CLI option and TypeScript 4.7 syntax!
Prettier Blog
<p>This release includes a new <code>--cache</code> 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.</p><p>We've also added support formatting for TypeScript 4.7 syntax!</p><p>If you enjoy Prettier and would like to support our work, consider sponsoring us directly via <a href="https://opencollective.com/prettier">our OpenCollective</a> or by sponsoring the projects we depend on, including <a href="https://opencollective.com/typescript-eslint">typescript-eslint</a>, <a href="https://opencollective.com/unified">remark</a>, and <a href="https://opencollective.com/babel">Babel</a>.</p>
2年前
記事のアイキャッチ画像
Prettier 2.6: new singleAttributePerLine option and new JavaScript features!
Prettier Blog
<p>This release includes a new <code>singleAttributePerLine</code> option. This is an option to print only one attribute per line in Vue SFC templates, HTML, and JSX. Per our <a href="https://prettier.io/docs/en/option-philosophy.html">Option Philosophy</a>, we would prefer not to add such an option. However, there are many users who want this feature, and major style guides like <a href="https://github.com/airbnb/javascript/blob/274c8d570155a05b016980294d4204c5711bce86/packages/eslint-config-airbnb/rules/react.js#L97-L99">Airbnb’s JavaScript Style Guide</a> and <a href="https://vuejs.org/style-guide/rules-strongly-recommended.html#multi-attribute-elements">Vue’s style guide</a> recommend the single attribute per line style. A <a href="https://github.com/prettier/prettier/pull/6644">PR</a> to add this feature was opened in October 2019, and both it and the <a href="https://github.com/prettier/prettier/issues/5501">corresponding issue</a> have received a significant amount of support fr
2年前
記事のアイキャッチ画像
Prettier begins paying maintainers
Prettier Blog
<p>Prettier, an opinionated code formatter for JavaScript and many web languages, has been accepting donations at <a href="https://opencollective.com/prettier">OpenCollective</a> 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.</p>
2年前
記事のアイキャッチ画像
Prettier 2.5: TypeScript 4.5 and MDX v2 comment syntax!
Prettier Blog
<p>This release adds support for <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/">TypeScript 4.5</a>'s new syntax and <a href="https://mdxjs.com/blog/v2/">MDX v2</a> comment syntax!</p><p>If you enjoy Prettier and would like to support our work, consider sponsoring us directly via <a href="https://opencollective.com/prettier">our OpenCollective</a> or by sponsoring the projects we depend on, including <a href="https://opencollective.com/typescript-eslint">typescript-eslint</a>, <a href="https://opencollective.com/unified">remark</a>, and <a href="https://opencollective.com/babel">Babel</a>.</p>
2年前
記事のアイキャッチ画像
Prettier 2.4: new bracketSameLine option and TypeScript 4.4 support!
Prettier Blog
<p>This release renames the <code>jsxBracketSameLine</code> option to <code>bracketSameLine</code>, which supports HTML, Vue, and Angular in addition to JSX. The old name has been deprecated.</p><p>We’ve also added support for <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html">TypeScript 4.4</a>, including new syntax features such as <a href="https://github.com/tc39/proposal-class-static-block">class <code>static</code> blocks</a>.</p><p>If you enjoy Prettier and would like to support our work, consider sponsoring us directly via <a href="https://opencollective.com/prettier">our OpenCollective</a> or by sponsoring the projects we depend on, including <a href="https://opencollective.com/typescript-eslint">typescript-eslint</a>, <a href="https://opencollective.com/unified">remark</a>, and <a href="https://opencollective.com/babel">Babel</a>.</p>
3年前
記事のアイキャッチ画像
Prettier 2.3. In which assignments are consistent, short keys non-breaking, and Handlebars official
Prettier Blog
<p>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 <a href="https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt"><code>ignoreRevsFile</code></a> to hide such wholesale changes from <code>git blame</code>, it might be about time.</p><p>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.</p><p>We are grateful to our financial contributors: <a href="https://engineering.salesforce.com/foss-fund-brings-more-than-just-financial-contributions-7b0664067b1e">Salesforce</a>, <a href="https://engineering.indeedblog.com/blog/2019/07/foss-fund-six-months-in/">Indeed</a>, <a href="https://blog.opencollective.com/fronten
3年前
記事のアイキャッチ画像
Prettier for Ruby goes v1.0 🎉
Prettier Blog
<p>After 1500 commits and 50 releases since July 2018, we're happy to announce that we've just released v1.0 of <a href="https://github.com/prettier/plugin-ruby">Prettier for Ruby</a>. In this blog post, we'd like to give a short overview of how the plugin works, its philosophy, and what to expect in the future.</p>
3年前
記事のアイキャッチ画像
Prettier 2.2: new JavaScript parsers, TS 4.1 and ESM standalone bundles
Prettier Blog
<p>This release supports new JavaScript parsers <a href="https://github.com/eslint/espree">espree</a> and <a href="https://github.com/meriyah/meriyah">meriyah</a>, supports <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-rc/">TypeScript 4.1</a>, ships ESM standalone bundles for modern browsers, and includes many bug fixes and improvements!</p>
4年前
記事のアイキャッチ画像
Prettier 2.1: new --embedded-language-formatting option and new JavaScript/TypeScript features!
Prettier Blog
<p>This release adds a new <code>--embedded-language-formatting</code> option, supports new JavaScript/TypeScript features, and includes many bug fixes and improvements!</p>
4年前
記事のアイキャッチ画像
Prettier 2.0 “2020”
Prettier Blog
<p>Better defaults, a better CLI and better heuristics. Oh, and TypeScript 3.8.</p><p>After a long and careful consideration, we decided to change the default values for the <code>trailingComma</code>, <code>arrowParens</code>, and <code>endOfLine</code> 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.</p>
4年前
記事のアイキャッチ画像
Prettier 1.19: Long awaited Vue option, TypeScript 3.7 and new JavaScript features
Prettier Blog
<p>This release adds the long awaited <code>--vue-indent-script-and-style</code> option, support for TypeScript 3.7 and some cutting edge JavaScript syntax. Not to mention a whole bunch of bug fixes and improvements!</p>
5年前
記事のアイキャッチ画像
Prettier 1.18: Lots of fixes and OpenCollective
Prettier Blog
<p>This release doesn't include shiny new features, but has lots of fixes for JavaScript, specially JSX and template literals, TypeScript and Markdown.</p><p>It's also a good opportunity to remind that Prettier is now accepting donations! If you enjoy Prettier and would like to support our work, head to our <a href="https://opencollective.com/prettier">OpenCollective</a>.</p>
5年前
記事のアイキャッチ画像
Prettier 1.17: More quotes options and support for shared configs
Prettier Blog
<p>This release brings long-requested flexibility to quotes around object properties, allows Prettier configuration to be shared in the form of packages, adds a <a href="https://developer.salesforce.com/docs/component-library/documentation/lwc">LWC</a> parser, adds support for new GraphQL syntax and fixes lots of formatting bugs.</p>
5年前
記事のアイキャッチ画像
Prettier 1.16: HTML improvements and better CRLF handling
Prettier Blog
<p>This release improves HTML formatting and contains better CRLF handling, newsyntax features, and fixes several bugs.</p>
5年前
記事のアイキャッチ画像
Prettier 1.15: HTML, Vue, Angular and MDX Support
Prettier Blog
<p>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.</p>
6年前
記事のアイキャッチ画像
Prettier 1.14: YAML Support
Prettier Blog
<p>This release adds YAML support, pragma (i.e. <code>/** @prettier */</code>) support for every language, and improves performance on large files. It also adds support for several new syntax features, and has a few formatting tweaks to make your code even prettier. ✨</p>
6年前
記事のアイキャッチ画像
Prettier 1.13: Conquering the web!
Prettier Blog
<p>This releases adds support for several new syntax features, formatting fixes and first-class support for working in the browser.</p>
6年前
記事のアイキャッチ画像
Prettier 1.12: Fixes, Features, and Formatting, Oh My!
Prettier Blog
<p>Hello everyone, and welcome to Prettier 1.12.0! This release contains a lot of bugfixes, formatting adjustments, new features for our plugin API, and new Markdown features.</p>
6年前
記事のアイキャッチ画像
Prettier for PHP 0.1: First alpha release 🎉
Prettier Blog
<p>After more than 200 merged pull requests since mid December 2017, we're happy to announce the first alpha release of <a href="https://github.com/prettier/plugin-php">Prettier for PHP</a>. In this blog post, we'd like to give a short overview of how the plugin works, its philosophy, and what to expect in the future.</p>
6年前
記事のアイキャッチ画像
Prettier 1.11: CSS fixes and new TypeScript feature support
Prettier Blog
<p>This release features a ton of CSS formatting fixes as well as support for some new TypeScript features, in addition to some general bugfixes for other languages.</p><p>Since the last release, the <a href="https://prettier.io">Prettier website</a> has gotten an all-new design thanks to <a href="https://github.com/orta">@orta</a>!</p><h3><a class="anchor" aria-hidden="true" id="facebook-is--prettier"></a><a href="#facebook-is--prettier" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Facebook is 💯% Prettier</h3><p>Ano...
6年前
記事のアイキャッチ画像
Prettier 1.10: One Year of Prettier 🎂
Prettier Blog
<p>Happy Prettier-versary! It's pretty incredible that Prettier was only released a year ago and has already seen such a massive adoption and great number of contributors. For this special release, we're going to do a small retrospective around the project.</p><p>It's also an exciting release in itself because Prettier now has partial support for <code>.vue</code> files and the internals have been refactored such that there's a proper plugin API in order to support different languages!</p>
6年前
記事のアイキャッチ画像
Prettier 1.9: JSX Fragments, EditorConfig and Arrow Parens
Prettier Blog
<p>This release adds an option for arrow function parens in arguments, support for the <a href="https://reactjs.org/blog/2017/11/28/react-v16.2.0-fragment-support.html">new JSX fragment syntax (<code>&lt;&gt;</code>)</a>, support for <code>.editorconfig</code> files, and nice additions to our GraphQL and Markdown support.</p>
6年前
記事のアイキャッチ画像
Prettier 1.8: Markdown Support
Prettier Blog
<p>This release adds Markdown support, a new <code>--insert-pragma</code> flag, fixes a number of formatting issues, adds support for some new <em>experimental</em> operators, and improves our editor integration support.</p>
7年前
記事のアイキャッチ画像
Prettier 1.7: JSX tweaks, Pragma, TypeScript and CSS fixes
Prettier Blog
<p>This release features some bugfixes and tweaks around JSX, TypeScript, CSS, and JavaScript formatting, as well as a couple new features.</p>
7年前
記事のアイキャッチ画像
Prettier 1.6: Config File, JSX
Prettier Blog
<p>This release adds configuration file support to Prettier, as well as some significant enhancements to JSX printing.</p>
7年前
記事のアイキャッチ画像
Prettier 1.5: GraphQL, CSS-in-JS & JSON
Prettier Blog
<p>This release adds GraphQL formatting support, CSS-in-JS (including styled-components), and JSON support to Prettier.</p>
7年前
記事のアイキャッチ画像
Prettier 1.4: TypeScript and CSS support
Prettier Blog
<p>This release introduces support for TypeScript, CSS, Less, and SCSS languages to Prettier!</p>
7年前
記事のアイキャッチ画像
Prettier 1.3
Prettier Blog
<p>This post provides an update to Facebook's adoption or Prettier, outlines our progress on TypeScript, and details some of the improvements and fixes included in the 1.3.0 release of Prettier.</p>
7年前
記事のアイキャッチ画像
Prettier 1.2
Prettier Blog
<p>1.0 is not the end of prettier, we're going to continue to work on the long tail of formatting issues in order to make it an awesome JavaScript code formatter. You should expect minor version releases like this one to change small things and edge cases but nothing major or controversial.</p>
7年前
記事のアイキャッチ画像
Releasing Prettier 1.0
Prettier Blog
<p><em>This post was written by <a href="https://twitter.com/vjeux">vjeux</a> and edited by<a href="https://twitter.com/jlongster">jlongster</a>, and originally published <a href="http://jlongster.com/prettier-1.0">here</a></em></p><p>We officially <a href="http://jlongster.com/A-Prettier-Formatter">announced</a><a href="https://github.com/prettier/prettier">prettier</a> over two months ago as a way tosolve the problem of wasting time formatting your code. It started as anexperiment but it clearly resonated with a lot of people, amassing ~7000 GitHubstars and over 100,000 monthly <code>npm downloads</code> in just two months.</p>
7年前