From 42ba4373f47a67a5d50756a76a57b2ce3a5524e5 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 17 Jan 2024 11:27:30 +0800 Subject: [PATCH] Release 3.2.3 --- .github/ISSUE_TEMPLATE/formatting.md | 2 +- .github/ISSUE_TEMPLATE/integration.md | 2 +- CHANGELOG.md | 48 +++++++++++++++++++ docs/browser.md | 32 ++++++------- package.json | 2 +- website/versioned_docs/version-stable/api.md | 2 +- .../versioned_docs/version-stable/browser.md | 32 ++++++------- 7 files changed, 84 insertions(+), 36 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index 0df60bded..e43296162 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.2.2** +**Prettier 3.2.3** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index b4a5566d9..67991a89c 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.2.2 +- Prettier Version: 3.2.3 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a65d7de2..9c3c1f0d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,51 @@ +# 3.2.3 + +[diff](https://github.com/prettier/prettier/compare/3.2.2...3.2.3) + +#### Throw errors for invalid code ([#15881](https://github.com/prettier/prettier/pull/15881) by [@fisker](https://github.com/fisker), [@Josh-Cena](https://github.com/Josh-Cena), [@auvred](https://github.com/auvred)) + + +```ts +// Input +1++; + +// Prettier 3.2.2 +1++; + +// Prettier 3.2.3 +SyntaxError: Invalid left-hand side expression in unary operation (1:1) +> 1 | 1++; + | ^ +``` + + +```ts +// Input +try {} catch (error = 1){} + +// Prettier 3.2.2 +try { +} catch (error) {} + +// Prettier 3.2.3 +SyntaxError: Catch clause variable cannot have an initializer. (1:23) +> 1 | try {} catch (error = 1){} + | ^ +``` + +#### Fix parser inference ([#15927](https://github.com/prettier/prettier/pull/15927) by [@fisker](https://github.com/fisker)) + + +```console +// Prettier 3.2.2 +prettier --file-info tsconfig.json +{ "ignored": false, "inferredParser": "json" } + +// Prettier 3.2.3 +prettier --file-info tsconfig.json +{ "ignored": false, "inferredParser": "jsonc" } +``` + # 3.2.2 [diff](https://github.com/prettier/prettier/compare/3.2.1...3.2.2) diff --git a/docs/browser.md b/docs/browser.md index ff257f9ad..1a02c9cdb 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -18,7 +18,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. @@ -29,8 +29,8 @@ See below for examples. ### Global ```html - - + + - + +