From 5a31ea77d47d0e1f0e5af13b83edef07db884898 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Sun, 21 Nov 2021 15:51:54 +0900 Subject: [PATCH] Regenerate draft --- website/blog/2021-11-21-2.5.0.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/website/blog/2021-11-21-2.5.0.md b/website/blog/2021-11-21-2.5.0.md index 657923745558..e51f8e82ec9f 100644 --- a/website/blog/2021-11-21-2.5.0.md +++ b/website/blog/2021-11-21-2.5.0.md @@ -208,6 +208,36 @@ const paragraph2 = css` ``` +#### Support ES2022 class-private-fields-in syntax in `espree` parser ([#11835](https://github.com/prettier/prettier/pull/11835) by [@fisker](https://github.com/fisker)) + + +```jsx +// Input +class Foo { + #brand; + static isC(obj) { + return #brand in Foo; + } +} + +// Prettier 2.4 +SyntaxError: Unexpected token #brand (4:12) + 2 | #brand; + 3 | static isC(obj) { +> 4 | return #brand in Foo; + | ^ + 5 | } + 6 | } + +// Prettier 2.5 +class Foo { + #brand; + static isC(obj) { + return #brand in Foo; + } +} +``` + ### TypeScript #### Fix formatting for tagged template decorators ([#11717](https://github.com/prettier/prettier/pull/11717) by [@sosukesuzuki](https://github.com/sosukesuzuki))