From 52829385bcc4d785e58ae2602c0b098a643523c9 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Sat, 13 Jul 2024 21:24:55 +0900 Subject: [PATCH] Release 3.3.3 --- .github/ISSUE_TEMPLATE/formatting.md | 2 +- .github/ISSUE_TEMPLATE/integration.md | 2 +- CHANGELOG.md | 63 +++++++++++++++++++ package.json | 2 +- .../versioned_docs/version-stable/browser.md | 32 +++++----- .../version-stable/configuration.md | 4 +- .../versioned_docs/version-stable/install.md | 6 +- .../version-stable/related-projects.md | 1 + 8 files changed, 87 insertions(+), 25 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index e2f4ccd7e..1b517c0c2 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you: --> -**Prettier 3.3.2** +**Prettier 3.3.3** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index ff5a90171..0075516bb 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE: **Environments:** -- Prettier Version: 3.3.2 +- Prettier Version: 3.3.3 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f90bcd30..1d65c56b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,66 @@ +# 3.3.3 + +[diff](https://github.com/prettier/prettier/compare/3.3.2...3.3.3) + +#### Add parentheses for nullish coalescing in ternary ([#16391](https://github.com/prettier/prettier/pull/16391) by [@cdignam-segment](https://github.com/cdignam-segment)) + +This change adds clarity to operator precedence. + + +```js +// Input +foo ? bar ?? foo : baz; +foo ?? bar ? a : b; +a ? b : foo ?? bar; + +// Prettier 3.3.2 +foo ? bar ?? foo : baz; +foo ?? bar ? a : b; +a ? b : foo ?? bar; + +// Prettier 3.3.3 +foo ? (bar ?? foo) : baz; +(foo ?? bar) ? a : b; +a ? b : (foo ?? bar); +``` + +#### Add parentheses for decorator expressions ([#16458](https://github.com/prettier/prettier/pull/16458) by [@y-schneider](https://github.com/y-schneider)) + +Prevent parentheses around member expressions or tagged template literals from being removed to follow the stricter parsing rules of TypeScript 5.5. + + +```ts +// Input +@(foo`tagged template`) +class X {} + +// Prettier 3.3.2 +@foo`tagged template` +class X {} + +// Prettier 3.3.3 +@(foo`tagged template`) +class X {} +``` + +#### Support `@let` declaration syntax ([#16474](https://github.com/prettier/prettier/pull/16474) by [@sosukesuzuki](https://github.com/sosukesuzuki)) + +Adds support for Angular v18 `@let` declaration syntax. + +Please see the following code example. The `@let` declaration allows you to define local variables within the template: + + +```html +@let name = 'Frodo'; + +

Dashboard for {{name}}

+Hello, {{name}} +``` + +For more details, please refer to the excellent blog post by the Angular Team: [Introducing @let in Angular](https://blog.angular.dev/introducing-let-in-angular-686f9f383f0f). + +We also appreciate the Angular Team for kindly answering our questions to implement this feature. + # 3.3.2 [diff](https://github.com/prettier/prettier/compare/3.3.1...3.3.2) diff --git a/package.json b/package.json index 27a38a45e..89d3f4952 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prettier", - "version": "3.4.0-dev", + "version": "3.3.3", "description": "Prettier is an opinionated code formatter", "bin": "./bin/prettier.cjs", "repository": "prettier/prettier", diff --git a/website/versioned_docs/version-stable/browser.md b/website/versioned_docs/version-stable/browser.md index 4eaf0f350..129fca49f 100644 --- a/website/versioned_docs/version-stable/browser.md +++ b/website/versioned_docs/version-stable/browser.md @@ -19,7 +19,7 @@ Required options: - **[`parser`](options.md#parser) (or [`filepath`](options.md#file-path))**: One of these options has to be specified for Prettier to know which parser to use. -- **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files in . Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON. +- **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files in . Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON. You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option. @@ -30,8 +30,8 @@ See below for examples. ### Global ```html - - + +