From d5f31710b2fc25f3f472e86f9ee00a561a17ffa2 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Tue, 29 Aug 2023 21:27:28 +0900 Subject: [PATCH] Release 3.0.3 --- .github/ISSUE_TEMPLATE/formatting.md | 2 +- .github/ISSUE_TEMPLATE/integration.md | 2 +- CHANGELOG.md | 74 +++++++++++++++++++ docs/browser.md | 32 ++++---- package.json | 2 +- .../versioned_docs/version-stable/browser.md | 32 ++++---- 6 files changed, 109 insertions(+), 35 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index f9e935fe7..eb94520eb 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.0.2** +**Prettier 3.0.3** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index 1f8999712..b808e2a67 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.0.2 +- Prettier Version: 3.0.3 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index 70bb10223..3c9ce8f8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,77 @@ +# 3.0.3 + +[diff](https://github.com/prettier/prettier/compare/3.0.2...3.0.3) + +#### Add `preferUnplugged: true` to `package.json` ([#15169](https://github.com/prettier/prettier/pull/15169) by [@fisker](https://github.com/fisker) and [@so1ve](https://github.com/so1ve)) + +Prettier v3 uses dynamic imports, user [will need to unplug Prettier](https://github.com/yarnpkg/berry/pull/5411#issuecomment-1523502224) when Yarn's PnP mode is enabled, add [`preferUnplugged: true`](https://yarnpkg.com/configuration/manifest#preferUnplugged) to `package.json`, so Yarn will install Prettier as unplug by default. + +#### Support shared config that forbids `require()` ([#15233](https://github.com/prettier/prettier/pull/15233) by [@fisker](https://github.com/fisker)) + +If an external shared config package is used, and the package `exports` don't have `require` or `default` export. + +In Prettier 3.0.2 Prettier fails when attempt to `require()` the package, and throws an error. + +```text +Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /package.json +``` + +#### Allow argument of `require()` to break ([#15256](https://github.com/prettier/prettier/pull/15256) by [@fisker](https://github.com/fisker)) + + +```jsx +// Input +const plugin = require( + global.STANDALONE + ? path.join(__dirname, "../standalone.js") + : path.join(__dirname, "..") +); + +// Prettier 3.0.2 +const plugin = require(global.STANDALONE + ? path.join(__dirname, "../standalone.js") + : path.join(__dirname, "..")); + +// Prettier 3.0.3 +const plugin = require( + global.STANDALONE + ? path.join(__dirname, "../standalone.js") + : path.join(__dirname, "..") +); +``` + +#### Do not print trailing commas in arrow function type parameter lists in `ts` code blocks ([#15286](https://github.com/prettier/prettier/pull/15286) by [@sosukesuzuki](https://github.com/sosukesuzuki)) + + +````md + +```ts +const foo = () => {} +``` + + +```ts +const foo = () => {} +``` + + +```ts +const foo = () => {} +``` +```` + +#### Support TypeScript 5.2 `using` / `await using` declaration ([#15321](https://github.com/prettier/prettier/pull/15321) by [@sosukesuzuki](https://github.com/sosukesuzuki)) + +Support for the upcoming Explicit Resource Management feature in ECMAScript. [`using` / `await using` declaration](https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#using-declarations-and-explicit-resource-management) + + +```tsx +{ + using foo = new Foo(); + await using bar = new Bar(); +} +``` + # 3.0.2 [diff](https://github.com/prettier/prettier/compare/3.0.1...3.0.2) diff --git a/docs/browser.md b/docs/browser.md index d428cafaa..646a486ed 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 - - + + - + +