diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index fefab43bd128..c790749e9b0e 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 2.8.7** +**Prettier 2.8.8** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index a50a5df0ccf5..7a0204a67921 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE: **Environments:** -- Prettier Version: 2.8.7 +- Prettier Version: 2.8.8 - Running Prettier via: - Runtime: - Operating System: diff --git a/CHANGELOG.md b/CHANGELOG.md index ff5a7d774a1d..cd23a035e260 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,64 @@ +# 2.8.8 + +[diff](https://github.com/prettier/prettier/compare/2.8.7...2.8.8) + +#### Allow decorators on private members and class expressions ([#14548](https://github.com/prettier/prettier/pull/14548) by [@fisker](https://github.com/fisker)) + + +```ts +// Input +class A { + @decorator() + #privateMethod () {} +} + +// Prettier 2.8.7 +SyntaxError: Decorators are not valid here. (2:3) + 1 | class A { +> 2 | @decorator() + | ^^^^^^^^^^^^ + 3 | #privateMethod () {} + 4 | } + +// Prettier 2.8.8 +class A { + @decorator() + #privateMethod() {} +} +``` + +#### Allow multiple decorators on same getter/setter ([#14584](https://github.com/prettier/prettier/pull/14584) by [@fisker](https://github.com/fisker)) + + +```ts +// Input +class A { + @decorator() + get foo () {} + + @decorator() + set foo (value) {} +} + +// Prettier 2.8.7 +SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3) + 3 | get foo () {} + 4 | +> 5 | @decorator() + | ^^^^^^^^^^^^ + 6 | set foo (value) {} + 7 | } + +// Prettier 2.8.8 +class A { + @decorator() + get foo() {} + + @decorator() + set foo(value) {} +} +``` + # 2.8.7 [diff](https://github.com/prettier/prettier/compare/2.8.6...2.8.7) diff --git a/docs/browser.md b/docs/browser.md index 2a48cf69dd7b..301191210a2d 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -20,8 +20,8 @@ Required options: - **`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 named - - `parser-*.js` in and - - `parser-*.mjs` in + - `parser-*.js` in and + - `parser-*.mjs` in You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option. @@ -32,8 +32,8 @@ See below for examples. ### Global ```html - - + + - + +