From 7fc196e96be43c0abf92fe28eb9e5c7ce3a87120 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Thu, 25 Nov 2021 23:12:16 +0900 Subject: [PATCH] Clean changelog_unreleased --- changelog_unreleased/blog-post-intro.md | 9 ------ changelog_unreleased/handlebars/11524.md | 14 --------- changelog_unreleased/html/11827.md | 30 ------------------ changelog_unreleased/javascript/11593.md | 15 --------- changelog_unreleased/javascript/11750.md | 20 ------------ changelog_unreleased/javascript/11800.md | 23 -------------- changelog_unreleased/javascript/11835.md | 13 -------- changelog_unreleased/markdown/11685.md | 21 ------------- changelog_unreleased/mdx/11563.md | 17 ----------- changelog_unreleased/scss/11637.md | 23 -------------- changelog_unreleased/scss/11683.md | 16 ---------- changelog_unreleased/typescript/11515.md | 37 ---------------------- changelog_unreleased/typescript/11717.md | 31 ------------------- changelog_unreleased/typescript/11721.md | 39 ------------------------ 14 files changed, 308 deletions(-) delete mode 100644 changelog_unreleased/blog-post-intro.md delete mode 100644 changelog_unreleased/handlebars/11524.md delete mode 100644 changelog_unreleased/html/11827.md delete mode 100644 changelog_unreleased/javascript/11593.md delete mode 100644 changelog_unreleased/javascript/11750.md delete mode 100644 changelog_unreleased/javascript/11800.md delete mode 100644 changelog_unreleased/javascript/11835.md delete mode 100644 changelog_unreleased/markdown/11685.md delete mode 100644 changelog_unreleased/mdx/11563.md delete mode 100644 changelog_unreleased/scss/11637.md delete mode 100644 changelog_unreleased/scss/11683.md delete mode 100644 changelog_unreleased/typescript/11515.md delete mode 100644 changelog_unreleased/typescript/11717.md delete mode 100644 changelog_unreleased/typescript/11721.md diff --git a/changelog_unreleased/blog-post-intro.md b/changelog_unreleased/blog-post-intro.md deleted file mode 100644 index 8c7a72329..000000000 --- a/changelog_unreleased/blog-post-intro.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -author: "Sosuke Suzuki (@sosukesuzuki)" -authorURL: "https://github.com/sosukesuzuki" -title: "Prettier 2.5: TypeScript 4.5 and MDX v2 comment syntax!" ---- - -This release adds support for [TypeScript 4.5](https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/)'s new syntax and [MDX v2](https://mdxjs.com/blog/v2/) comment syntax! - -If you enjoy Prettier and would like to support our work, consider sponsoring us directly via [our OpenCollective](https://opencollective.com/prettier) or by sponsoring the projects we depend on, including [typescript-eslint](https://opencollective.com/typescript-eslint), [remark](https://opencollective.com/unified), and [Babel](https://opencollective.com/babel). diff --git a/changelog_unreleased/handlebars/11524.md b/changelog_unreleased/handlebars/11524.md deleted file mode 100644 index 09d8fd6c4..000000000 --- a/changelog_unreleased/handlebars/11524.md +++ /dev/null @@ -1,14 +0,0 @@ -#### Uses the opposite quote type for quotes inside mustache statements in attributes (#11524 by @bmaehr) - - -```hbs -{{!-- Input --}} -
- -{{!-- Prettier main --}} -
- -{{!-- Prettier stable --}} -
- -``` diff --git a/changelog_unreleased/html/11827.md b/changelog_unreleased/html/11827.md deleted file mode 100644 index 035094bdc..000000000 --- a/changelog_unreleased/html/11827.md +++ /dev/null @@ -1,30 +0,0 @@ -#### [HIGHLIGHT]Collapse HTML `class` attributes onto one line (#11827 by @jlongster) - -Reverts [#7865](https://github.com/prettier/prettier/pull/7865). - -While this was intended to be useful for users of CSS libraries like Tailwind that tend to result in large numbers of classes on elements, it became clear that our heuristics for where to split the class list on to multiple lines were unable to consistently produce good results. We’re still considering better ways to format HTML with lots of classes — consider [discussing with us](https://github.com/prettier/prettier/issues/7863). - - -```html - -
- - -
- - -
- -``` diff --git a/changelog_unreleased/javascript/11593.md b/changelog_unreleased/javascript/11593.md deleted file mode 100644 index 02b9061b2..000000000 --- a/changelog_unreleased/javascript/11593.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Fix parentheses around sequence expression as body of arrow chain (#11593 by @bakkot) - -The required parentheses around sequence expressions as the body of arrow functions are now preserved for chained arrows. Previously, Prettier removed them, which resulted in invalid syntax. - - -```jsx -// Input -const f = () => () => (0, 1); - -// Prettier stable -const f = () => () => 0, 1; - -// Prettier main -const f = () => () => (0, 1); -``` diff --git a/changelog_unreleased/javascript/11750.md b/changelog_unreleased/javascript/11750.md deleted file mode 100644 index 38164e922..000000000 --- a/changelog_unreleased/javascript/11750.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Ignore errors for sloppy mode syntax (#11750 by @fisker, #11778 by @sosukesuzuki) - -JavaScript’s [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) adds several useful errors to prevent mistakes. Some of these errors are syntax errors that occur at parse time. Since Prettier’s goal is to format all syntactically valid JavaScript code regardless of whether it will actually run, we’ve opted to leave this error checking to linters, compilers, and the runtime. - - -```jsx -// Input -function foo() { var bar = 1; delete bar; } - -// Prettier stable -SyntaxError: Deleting local variable in strict mode. (1:31) -> 1 | function foo() { var bar = 1; delete bar; } - | ^ - -// Prettier main -function foo() { - var bar = 1; - delete bar; -} -``` diff --git a/changelog_unreleased/javascript/11800.md b/changelog_unreleased/javascript/11800.md deleted file mode 100644 index 43ffdef4f..000000000 --- a/changelog_unreleased/javascript/11800.md +++ /dev/null @@ -1,23 +0,0 @@ -#### Respect spacing for between expressions and parentheses in embedded CSS (#11800 by @sosukesuzuki) - - -```jsx -// Input -const paragraph2 = css` - transform1: ${expr}(30px); - transform2: ${expr} (30px); -`; - -// Prettier 2.4 -const paragraph2 = css` - transform1: ${expr} (30px); - transform2: ${expr} (30px); -`; - -// Prettier 2.5 -const paragraph2 = css` - transform1: ${expr}(30px); - transform2: ${expr} (30px); -`; - -``` diff --git a/changelog_unreleased/javascript/11835.md b/changelog_unreleased/javascript/11835.md deleted file mode 100644 index aa71cd962..000000000 --- a/changelog_unreleased/javascript/11835.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Support ES2022 class-private-fields-in syntax in `espree` parser (#11835 by @fisker) - - -```jsx -// Example -class Foo { - #brand; - static isC(obj) { - return #brand in Foo; - } -} - -``` diff --git a/changelog_unreleased/markdown/11685.md b/changelog_unreleased/markdown/11685.md deleted file mode 100644 index 73d8dd3df..000000000 --- a/changelog_unreleased/markdown/11685.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Keep trailing commas for type parameters in embedded TSX (#11685 by @sosukesuzuki) - -The trailing comma is necessary to prevent TypeScript from treating the `` as the beginning of a JSX expression. - - -````md - -```tsx -const test = (value: T) => {}; -``` - - -```tsx -const test = (value: T) => {}; -``` - - -```tsx -const test = (value: T) => {}; -``` -```` diff --git a/changelog_unreleased/mdx/11563.md b/changelog_unreleased/mdx/11563.md deleted file mode 100644 index bd85c2f78..000000000 --- a/changelog_unreleased/mdx/11563.md +++ /dev/null @@ -1,17 +0,0 @@ -#### [HIGHLIGHT]Add support for MDX v2 comment syntax (#11563 by @wooorm) - -This adds basic support for MDX v2 comment syntax (JavaScript-style comments) in addition to the existing support MDX v1 comment syntax (HTML-style comments). - -**Note**: Prettier currently only supports the new comment syntax for single-line comments (so that `{/* prettier-ignore */}` can be used), and doesn’t support the rest of MDX v2. - - -```mdx -Input: -{/*A comment*/} - -Prettier stable: -{/_A comment_/} - -Prettier main: -{/*A comment*/} -``` diff --git a/changelog_unreleased/scss/11637.md b/changelog_unreleased/scss/11637.md deleted file mode 100644 index b3c7b257d..000000000 --- a/changelog_unreleased/scss/11637.md +++ /dev/null @@ -1,23 +0,0 @@ -#### Improve `@use with` formatting (#11637 by @sosukesuzuki) - - -```scss -// Input -@use 'library' with ( - $black: #222, - $border-radius: 0.1rem, - $font-family: 'Helvetica, sans-serif' -); - -// Prettier stable -@use "library" with - ($black: #222, $border-radius: 0.1rem, $font-family: "Helvetica, sans-serif"); - -// Prettier main -@use 'library' with ( - $black: #222, - $border-radius: 0.1rem, - $font-family: 'Helvetica, sans-serif' -); - -``` diff --git a/changelog_unreleased/scss/11683.md b/changelog_unreleased/scss/11683.md deleted file mode 100644 index 1c2bf1643..000000000 --- a/changelog_unreleased/scss/11683.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Fix `@forward with` formatting error (#11683 by @sriramarul, @sosukesuzuki) - - -```scss -// Input -@forward 'foo.scss' with ($components: red); - -// Prettier stable -TypeError: Cannot read properties of undefined (reading 'type') - -// Prettier main -@forward "foo.scss" with ( - $components: red -); - -``` diff --git a/changelog_unreleased/typescript/11515.md b/changelog_unreleased/typescript/11515.md deleted file mode 100644 index b04f2c23a..000000000 --- a/changelog_unreleased/typescript/11515.md +++ /dev/null @@ -1,37 +0,0 @@ -#### [HIGHLIGHT]Avoid extra offset in arrow function body when using long types (#11515 by @kachkaev and @thorn0) - -Starting with Prettier 2.3.0, type declarations in arrow functions could affect function body indentation. Changing the length of the type annotation could produce large diffs and thus increased the chance of git conflicts. To prevent this, function body offset was stabilized.
-**Note**: This change may affect a large number of lines in your codebase. - - -```tsx -// Input -const MyComponentWithLongName: React.VoidFunctionComponent = ({ x, y }) => { - const a = useA(); - return
{x + y + a}
; -}; - -// Prettier 2.2 and below -const MyComponentWithLongName: React.VoidFunctionComponent = ({ - x, - y, -}) => { - const a = useA(); - return
{x + y + a}
; -}; - -// Prettier stable -const MyComponentWithLongName: React.VoidFunctionComponent = - ({ x, y }) => { - const a = useA(); - return
{x + y + a}
; - }; - -// Prettier main -const MyComponentWithLongName: React.VoidFunctionComponent< - MyComponentWithLongNameProps -> = ({ x, y }) => { - const a = useA(); - return
{x + y + a}
; -}; -``` diff --git a/changelog_unreleased/typescript/11717.md b/changelog_unreleased/typescript/11717.md deleted file mode 100644 index e45402b58..000000000 --- a/changelog_unreleased/typescript/11717.md +++ /dev/null @@ -1,31 +0,0 @@ -#### Remove unnecessary parentheses for decorators (#11717, #11849 by @sosukesuzuki) - - -```tsx -// Input -class Test { - @foo`bar` - test1: string = "test" - - @test().x("global").y() - test2: string = "test"; -} - -// Prettier stable -class Test { - @(foo`bar`) - test: string = "test" - - @(test().x("global").y()) - test2: string = "test"; -} - -// Prettier main -class Test { - @foo`bar` - test: string = "test" - - @test().x("global").y() - test2: string = "test"; -} -``` diff --git a/changelog_unreleased/typescript/11721.md b/changelog_unreleased/typescript/11721.md deleted file mode 100644 index 2c0796985..000000000 --- a/changelog_unreleased/typescript/11721.md +++ /dev/null @@ -1,39 +0,0 @@ -#### [HIGHLIGHT]Support TypeScript 4.5 (#11721, #11723, #11813 by @sosukesuzuki) - -We’ve added support for TypeScript 4.5’s new syntax features: - -##### [`type` Modifiers on Import Names](https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/#type-on-import-names) - - -```ts -// Example -import { type A } from "mod"; - -``` - -##### [Private Field Presence Checks](https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/#private-field-presence-checks) - - -```ts -// Example -class Foo { - #prop1; - method() { - return #prop1 in this; - } -} - -``` - -##### [Import Assertions](https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/#import-assertions) - - -```ts -// Example -import obj from "./something.json" assert { type: "json" }; - -``` - -##### Handle `.mts` and `.cts` - -Prettier will now format files with `.mts` and `.cts` extensions as TypeScript.