From c4905e5be96b64e604a7984ba204ad7ed1318f9a Mon Sep 17 00:00:00 2001 From: fisker Date: Thu, 27 Nov 2025 16:31:35 +0800 Subject: [PATCH] Clean changelog_unreleased --- changelog_unreleased/angular/17722.md | 21 --- changelog_unreleased/angular/17862.md | 15 -- changelog_unreleased/angular/18047.md | 13 -- changelog_unreleased/api/17679.md | 5 - changelog_unreleased/api/17860.md | 18 --- changelog_unreleased/api/18055.md | 28 ---- changelog_unreleased/api/18070.md | 5 - changelog_unreleased/api/18072.md | 3 - changelog_unreleased/blog-post-intro.md | 14 -- changelog_unreleased/cli/18124.md | 3 - changelog_unreleased/css/17841.md | 25 --- changelog_unreleased/css/17899.md | 17 -- changelog_unreleased/css/17929.md | 28 ---- changelog_unreleased/css/17938.md | 20 --- changelog_unreleased/css/18114.md | 19 --- changelog_unreleased/css/18228.md | 31 ---- changelog_unreleased/flow/17681.md | 26 ---- changelog_unreleased/flow/17792.md | 19 --- changelog_unreleased/graphql/18214.md | 28 ---- changelog_unreleased/handlebars/17781.md | 20 --- changelog_unreleased/handlebars/17856.md | 25 --- changelog_unreleased/handlebars/18065.md | 27 ---- changelog_unreleased/handlebars/18133.md | 14 -- changelog_unreleased/html/17879.md | 22 --- changelog_unreleased/html/17909.md | 26 ---- changelog_unreleased/javascript/17329.md | 19 --- changelog_unreleased/javascript/17708.md | 10 -- changelog_unreleased/javascript/17723.md | 44 ------ changelog_unreleased/javascript/17876.md | 57 ------- changelog_unreleased/javascript/17882.md | 40 ----- changelog_unreleased/javascript/17998.md | 31 ---- changelog_unreleased/javascript/18037.md | 20 --- changelog_unreleased/javascript/18087.md | 42 ----- changelog_unreleased/javascript/18099.md | 18 --- changelog_unreleased/javascript/18108.md | 25 --- changelog_unreleased/javascript/18147.md | 48 ------ changelog_unreleased/javascript/18163.md | 16 -- changelog_unreleased/javascript/18172.md | 27 ---- changelog_unreleased/javascript/18205.md | 49 ------ changelog_unreleased/javascript/18206.md | 40 ----- changelog_unreleased/javascript/18243.md | 27 ---- changelog_unreleased/javascript/18245.md | 21 --- changelog_unreleased/javascript/18300.md | 20 --- changelog_unreleased/javascript/18325.md | 15 -- changelog_unreleased/less/17820.md | 26 ---- changelog_unreleased/less/17983.md | 31 ---- changelog_unreleased/markdown/17813.md | 28 ---- changelog_unreleased/markdown/17965.md | 4 - changelog_unreleased/markdown/18010.md | 18 --- changelog_unreleased/mdx/17996.md | 18 --- changelog_unreleased/scss/17836.md | 19 --- changelog_unreleased/scss/17903.md | 19 --- changelog_unreleased/typescript/17421.md | 30 ---- changelog_unreleased/typescript/17724.md | 13 -- changelog_unreleased/typescript/17785.md | 13 -- changelog_unreleased/typescript/17798.md | 27 ---- changelog_unreleased/typescript/18035.md | 20 --- changelog_unreleased/typescript/18043.md | 20 --- changelog_unreleased/typescript/18094.md | 189 ----------------------- changelog_unreleased/typescript/18109.md | 34 ---- changelog_unreleased/typescript/18110.md | 57 ------- changelog_unreleased/typescript/18118.md | 42 ----- changelog_unreleased/typescript/18161.md | 16 -- changelog_unreleased/typescript/18162.md | 28 ---- changelog_unreleased/typescript/18165.md | 25 --- changelog_unreleased/typescript/18197.md | 21 --- changelog_unreleased/yaml/17843.md | 18 --- changelog_unreleased/yaml/18296.md | 33 ---- changelog_unreleased/yaml/18324.md | 15 -- 69 files changed, 1805 deletions(-) delete mode 100644 changelog_unreleased/angular/17722.md delete mode 100644 changelog_unreleased/angular/17862.md delete mode 100644 changelog_unreleased/angular/18047.md delete mode 100644 changelog_unreleased/api/17679.md delete mode 100644 changelog_unreleased/api/17860.md delete mode 100644 changelog_unreleased/api/18055.md delete mode 100644 changelog_unreleased/api/18070.md delete mode 100644 changelog_unreleased/api/18072.md delete mode 100644 changelog_unreleased/blog-post-intro.md delete mode 100644 changelog_unreleased/cli/18124.md delete mode 100644 changelog_unreleased/css/17841.md delete mode 100644 changelog_unreleased/css/17899.md delete mode 100644 changelog_unreleased/css/17929.md delete mode 100644 changelog_unreleased/css/17938.md delete mode 100644 changelog_unreleased/css/18114.md delete mode 100644 changelog_unreleased/css/18228.md delete mode 100644 changelog_unreleased/flow/17681.md delete mode 100644 changelog_unreleased/flow/17792.md delete mode 100644 changelog_unreleased/graphql/18214.md delete mode 100644 changelog_unreleased/handlebars/17781.md delete mode 100644 changelog_unreleased/handlebars/17856.md delete mode 100644 changelog_unreleased/handlebars/18065.md delete mode 100644 changelog_unreleased/handlebars/18133.md delete mode 100644 changelog_unreleased/html/17879.md delete mode 100644 changelog_unreleased/html/17909.md delete mode 100644 changelog_unreleased/javascript/17329.md delete mode 100644 changelog_unreleased/javascript/17708.md delete mode 100644 changelog_unreleased/javascript/17723.md delete mode 100644 changelog_unreleased/javascript/17876.md delete mode 100644 changelog_unreleased/javascript/17882.md delete mode 100644 changelog_unreleased/javascript/17998.md delete mode 100644 changelog_unreleased/javascript/18037.md delete mode 100644 changelog_unreleased/javascript/18087.md delete mode 100644 changelog_unreleased/javascript/18099.md delete mode 100644 changelog_unreleased/javascript/18108.md delete mode 100644 changelog_unreleased/javascript/18147.md delete mode 100644 changelog_unreleased/javascript/18163.md delete mode 100644 changelog_unreleased/javascript/18172.md delete mode 100644 changelog_unreleased/javascript/18205.md delete mode 100644 changelog_unreleased/javascript/18206.md delete mode 100644 changelog_unreleased/javascript/18243.md delete mode 100644 changelog_unreleased/javascript/18245.md delete mode 100644 changelog_unreleased/javascript/18300.md delete mode 100644 changelog_unreleased/javascript/18325.md delete mode 100644 changelog_unreleased/less/17820.md delete mode 100644 changelog_unreleased/less/17983.md delete mode 100644 changelog_unreleased/markdown/17813.md delete mode 100644 changelog_unreleased/markdown/17965.md delete mode 100644 changelog_unreleased/markdown/18010.md delete mode 100644 changelog_unreleased/mdx/17996.md delete mode 100644 changelog_unreleased/scss/17836.md delete mode 100644 changelog_unreleased/scss/17903.md delete mode 100644 changelog_unreleased/typescript/17421.md delete mode 100644 changelog_unreleased/typescript/17724.md delete mode 100644 changelog_unreleased/typescript/17785.md delete mode 100644 changelog_unreleased/typescript/17798.md delete mode 100644 changelog_unreleased/typescript/18035.md delete mode 100644 changelog_unreleased/typescript/18043.md delete mode 100644 changelog_unreleased/typescript/18094.md delete mode 100644 changelog_unreleased/typescript/18109.md delete mode 100644 changelog_unreleased/typescript/18110.md delete mode 100644 changelog_unreleased/typescript/18118.md delete mode 100644 changelog_unreleased/typescript/18161.md delete mode 100644 changelog_unreleased/typescript/18162.md delete mode 100644 changelog_unreleased/typescript/18165.md delete mode 100644 changelog_unreleased/typescript/18197.md delete mode 100644 changelog_unreleased/yaml/17843.md delete mode 100644 changelog_unreleased/yaml/18296.md delete mode 100644 changelog_unreleased/yaml/18324.md diff --git a/changelog_unreleased/angular/17722.md b/changelog_unreleased/angular/17722.md deleted file mode 100644 index ad5a44e13..000000000 --- a/changelog_unreleased/angular/17722.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Support Angular 21 (#17722, #18294 by @fisker) - -Angular 20.1 added support for new assignment operators. -Angular 21 added support for regular expression. - - -```html - -{{ /\d+/g}} - - -{{ /\d+/g}} - - -{{ /\d+/g }} -``` diff --git a/changelog_unreleased/angular/17862.md b/changelog_unreleased/angular/17862.md deleted file mode 100644 index f0a1fae71..000000000 --- a/changelog_unreleased/angular/17862.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Fix comments get duplicated in interpolation (#17862 by @fisker) - - -```html - -{{a() // comment}} - - -{{ a(// comment) // comment }} - - -{{ - a() // comment -}} -``` diff --git a/changelog_unreleased/angular/18047.md b/changelog_unreleased/angular/18047.md deleted file mode 100644 index e2c45380f..000000000 --- a/changelog_unreleased/angular/18047.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Fix formatting of "non-null assertion" (#18047 by @fisker) - - -```html - -{{ foo?.bar!.baz }} - - -{{ (foo?.bar)!.baz }} - - -{{ foo?.bar!.baz }} -``` diff --git a/changelog_unreleased/api/17679.md b/changelog_unreleased/api/17679.md deleted file mode 100644 index 1565b6967..000000000 --- a/changelog_unreleased/api/17679.md +++ /dev/null @@ -1,5 +0,0 @@ -#### Allow `plugin.parser.preprocess()` to return a `Promise` (#17679 by @fisker) - -Align with [`plugin.printer.preprocess()`](https://prettier.io/docs/plugins#optional-preprocess), which allows to return a `Promise`. - -We still suggest move your async work into `plugin.parser.parse()`, which already allow to return a `Promise`, we may remove support for `plugin.parser.preprocess()` in future. diff --git a/changelog_unreleased/api/17860.md b/changelog_unreleased/api/17860.md deleted file mode 100644 index a8e96fe00..000000000 --- a/changelog_unreleased/api/17860.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Allow `AstPath#call()` to access property of nullish properties (#17860 by @fisker) - -Previously, to check for a possible non-existent child node, we had to ensure the node existed first. - -```js -const isFoo = path.call(() => path.node?.type === "Foo", "foo", "bar"); -// Uncaught TypeError: Cannot read properties of undefined (reading 'bar') -``` - -We have to - -```js -const isFoo = - path.node.foo?.bar && - path.call(() => path.node?.type === "Foo", "foo", "bar"); -``` - -Since Prettier main, accessing a property of nullish properties no longer throws errors. diff --git a/changelog_unreleased/api/18055.md b/changelog_unreleased/api/18055.md deleted file mode 100644 index 8b7f949c6..000000000 --- a/changelog_unreleased/api/18055.md +++ /dev/null @@ -1,28 +0,0 @@ -#### Pass ancestors to `plugin.printer.canAttachComment()` (#18055 by @fisker) - -This prevent attaching comments to a specific child of node. - -For example in this JavaScript code `const object = {property};`, the `Identifier` node (`property`) appears as both `Property.key` and `Property.value` in the AST, obviously it can only print once, if the comment is attached to the non-printable child the comment will get lost. - -Plugins can now avoid this by adding a `canAttachComment` like this: - -```js -export const canAttachComment = (node, [parent]) => - !( - parent?.type === "Property" && - parent.shorthand && - parent.key === node && - parent.key !== parent.value - ); - -export const print = (path, options, print) => { - const { node } = path; - switch (node.type) { - case "Property": - if (node.shorthand) { - return print("value"); - } - // ... - } -}; -``` diff --git a/changelog_unreleased/api/18070.md b/changelog_unreleased/api/18070.md deleted file mode 100644 index 8d04ebd39..000000000 --- a/changelog_unreleased/api/18070.md +++ /dev/null @@ -1,5 +0,0 @@ -#### Add support for `plugin.printer.printPrettierIgnored()` (#18070 by @fisker) - -For a node with `prettier-ignore` comment, Prettier prints the text of the node directly. However, this may cause problems, for example, the node needs to be parenthesized or needs to print a leading semicolon to prevent ASI issue in `--no-semi` mode. - -Since Prettier main, plugins can add `printPrettierIgnored()` function to the printer to customize the `prettier-ignore`d node print process. This function uses the extract same signature as [`plugin.printer.print()`](https://prettier.io/docs/plugins#print) diff --git a/changelog_unreleased/api/18072.md b/changelog_unreleased/api/18072.md deleted file mode 100644 index 7b2ca56c4..000000000 --- a/changelog_unreleased/api/18072.md +++ /dev/null @@ -1,3 +0,0 @@ -#### Allow plugin to provide an `estree` printer (#18072 by @fisker) - -Previously, if a plugin wanted to make a plugin with `estree` printer that outputs different code based on the built-in one, plugin need provide both `parsers` and `printers`. Prettier main allows a plugin to create a plugin that only provides `estree` printer. diff --git a/changelog_unreleased/blog-post-intro.md b/changelog_unreleased/blog-post-intro.md deleted file mode 100644 index 9196112da..000000000 --- a/changelog_unreleased/blog-post-intro.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -authors: "fisker" -title: "Prettier 3.7: Improved formatting consistency and new plugin features!" ---- - -We are excited to announce Prettier 3.7! This release focuses on polishing the TypeScript and Flow experience, specifically by aligning the formatting of classes and interfaces to be more consistent and predictable. We also want your opinion on the upcoming change to fix [inconsistent opening brace print logic of class and interface body](https://github.com/prettier/prettier/issues/18115). - -Additionally, we also fixed lots of bugs, added support for new features in Angular 21 and Graphql 16.12, added Front Matter support to Handlebars. - -For plugin developers, we've added new APIs to give you more control over comment attachment and handling of ignored nodes. - -If you appreciate Prettier and would like to support our work, please consider sponsoring us directly via [our OpenCollective](https://opencollective.com/prettier) or by sponsoring the projects we depend on. Thank you for your continued support! - - diff --git a/changelog_unreleased/cli/18124.md b/changelog_unreleased/cli/18124.md deleted file mode 100644 index 2ef6af5bc..000000000 --- a/changelog_unreleased/cli/18124.md +++ /dev/null @@ -1,3 +0,0 @@ -#### Avoid creating `node_modules/.cache/` directory when `--cache` is not enabled (#18124 by @chiawendt) - -Run `prettier .` without `--cache` no longer creates an empty `node_modules/.cache/` directory. diff --git a/changelog_unreleased/css/17841.md b/changelog_unreleased/css/17841.md deleted file mode 100644 index c438b0932..000000000 --- a/changelog_unreleased/css/17841.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Handle attribute selector with case-sensitive and uppercase case-insensitive flags (#17841, #17865 by @kovsu) - - -```css -/* Input */ -[type=a s], -[type=a S], -[type=a I] { - list-style-type: lower-alpha; -} - -/* Prettier stable */ -[type="a s"], -[type="a S"], -[type="a I"] { - list-style-type: lower-alpha; -} - -/* Prettier main */ -[type="a" s], -[type="a" S], -[type="a" I] { - list-style-type: lower-alpha; -} -``` diff --git a/changelog_unreleased/css/17899.md b/changelog_unreleased/css/17899.md deleted file mode 100644 index f3edb9c4d..000000000 --- a/changelog_unreleased/css/17899.md +++ /dev/null @@ -1,17 +0,0 @@ -#### Fix crash when formatting special custom properties (#17899 by @fisker) - - -```css -/* Input */ -:root { - --l: , #000; -} - -/* Prettier stable */ -TypeError: Cannot read properties of undefined (reading 'value') - -/* Prettier main */ -:root { - --l: , #000; -} -``` diff --git a/changelog_unreleased/css/17929.md b/changelog_unreleased/css/17929.md deleted file mode 100644 index e625feb56..000000000 --- a/changelog_unreleased/css/17929.md +++ /dev/null @@ -1,28 +0,0 @@ -#### Fix selector been lowercased incorrectly inside css modules (#17929 by @kovsu) - - -```css -/* Input */ -:export { - nest: { - myColor: blue; - } - myColor: red; -} - -/* Prettier stable */ -:export { - nest: { - mycolor: blue; - } - myColor: red; -} - -/* Prettier main */ -:export { - nest: { - myColor: blue; - } - myColor: red; -} -``` diff --git a/changelog_unreleased/css/17938.md b/changelog_unreleased/css/17938.md deleted file mode 100644 index dba82df34..000000000 --- a/changelog_unreleased/css/17938.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Fix formatting of CSS selectors contains `//` (#17938 by @kovsu) - - -```css -/* Input */ -a[href="http://example.com"] { - color: red; -} - -/* Prettier stable */ -a[href="http://example.com"] -{ - color: red; -} - -/* Prettier main */ -a[href="http://example.com"] { - color: red; -} -``` diff --git a/changelog_unreleased/css/18114.md b/changelog_unreleased/css/18114.md deleted file mode 100644 index 8645d2adc..000000000 --- a/changelog_unreleased/css/18114.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Remove unexpected space between font size and line height (#18114 by @kovsu) - - -```css -/* Input */ -a { - font: var(--size)/1; -} - -/* Prettier stable */ -a { - font: var(--size) / 1; -} - -/* Prettier main */ -a { - font: var(--size)/1; -} -``` diff --git a/changelog_unreleased/css/18228.md b/changelog_unreleased/css/18228.md deleted file mode 100644 index b73d4d6cf..000000000 --- a/changelog_unreleased/css/18228.md +++ /dev/null @@ -1,31 +0,0 @@ -#### Fix extra indent for CSS comma-separated values after a block comment (#18228 by @seiyab) - - -```css -/* Input */ -.foo { - background-image: - linear-gradient(to top, blue, red 100%), - /* texture */ - repeating-linear-gradient(90deg, pink, yellow 20px, green 20px, pink 40px), - repeating-linear-gradient(90deg, pink, yellow 20px, green 20px, pink 40px); -} - -/* Prettier stable */ -.foo { - background-image: - linear-gradient(to top, blue, red 100%), - /* texture */ - repeating-linear-gradient(90deg, pink, yellow 20px, green 20px, pink 40px), - repeating-linear-gradient(90deg, pink, yellow 20px, green 20px, pink 40px); -} - -/* Prettier main */ -.foo { - background-image: - linear-gradient(to top, blue, red 100%), - /* texture */ - repeating-linear-gradient(90deg, pink, yellow 20px, green 20px, pink 40px), - repeating-linear-gradient(90deg, pink, yellow 20px, green 20px, pink 40px); -} -``` diff --git a/changelog_unreleased/flow/17681.md b/changelog_unreleased/flow/17681.md deleted file mode 100644 index 998143e73..000000000 --- a/changelog_unreleased/flow/17681.md +++ /dev/null @@ -1,26 +0,0 @@ -#### Add basic support for "match" syntax (#17681 by @fisker) - - -```jsx -// Input -const e = match (a) { - 1 => true, - 'foo' => false, - 2 => {obj: 'literal'}, -}; - -// Prettier stable -SyntaxError: Unexpected token `{`, expected the token `;` (1:21) -> 1 | const e = match (a) { - | ^ - 2 | 1 => true, - 3 | 'foo' => false, - 4 | 2 => {obj: 'literal'}, - -// Prettier main -const e = match (a) { - 1 => true, - "foo" => false, - 2 => { obj: "literal" }, -}; -``` diff --git a/changelog_unreleased/flow/17792.md b/changelog_unreleased/flow/17792.md deleted file mode 100644 index 5be03aee4..000000000 --- a/changelog_unreleased/flow/17792.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Add support for opaque type with lower and upper bound (#17792 by @SamChou19815) - - -```jsx -// Input -opaque type Counter super empty extends Box = Container; -opaque type Counter super Box = Container; -declare opaque type Counter super empty extends Box; -declare opaque type Counter super Box; - -// Prettier stable -SyntaxError: Unexpected identifier, expected the token `=` (1:21) - -// Prettier main -opaque type Counter super empty extends Box = Container; -opaque type Counter super Box = Container; -declare opaque type Counter super empty extends Box; -declare opaque type Counter super Box; -``` diff --git a/changelog_unreleased/graphql/18214.md b/changelog_unreleased/graphql/18214.md deleted file mode 100644 index 7c80b78fd..000000000 --- a/changelog_unreleased/graphql/18214.md +++ /dev/null @@ -1,28 +0,0 @@ -#### Support "executable descriptions" (#18214 by @fisker) - - -```gql -# Input -"Description" -query { - node { - id - } -} - -# Prettier stable -SyntaxError: Syntax Error: Unexpected description, descriptions are supported only on type definitions. (1:1) -> 1 | "Description" - | ^ - 2 | query { - 3 | node { - 4 | id - -# Prettier main -"Description" -query { - node { - id - } -} -``` diff --git a/changelog_unreleased/handlebars/17781.md b/changelog_unreleased/handlebars/17781.md deleted file mode 100644 index b4fd1d22c..000000000 --- a/changelog_unreleased/handlebars/17781.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Added Front Matter support to Handlebars (#17781 by @Codezilluh) - -Front matter can now be used in Handlebars. - - -```hbs ---- -title: My page title -keywords: - - word - - other word ---- - -

{{title}}

-
    - {{#each keywords}} -
  • {{this}}
  • - {{/each}} -
-``` diff --git a/changelog_unreleased/handlebars/17856.md b/changelog_unreleased/handlebars/17856.md deleted file mode 100644 index 865d49086..000000000 --- a/changelog_unreleased/handlebars/17856.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Preserve `else if` syntax for custom helpers (#17856 by @kovsu) - - -```hbs -{{! Input }} -{{#animated-if this.foo}} -foo content -{{else if (this.bar)}} -bar content -{{/animated-if}} - -{{! Prettier stable }} -{{#animated-if this.foo}} - foo content -{{else}}{{#if (this.bar)}} - bar content - {{/if}}{{/animated-if}} - -{{! Prettier main }} -{{#animated-if this.foo}} - foo content -{{else if (this.bar)}} - bar content -{{/animated-if}} -``` diff --git a/changelog_unreleased/handlebars/18065.md b/changelog_unreleased/handlebars/18065.md deleted file mode 100644 index bac303357..000000000 --- a/changelog_unreleased/handlebars/18065.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Remove extra blank lines in ` - -{{! Prettier stable (--html-whitespace-sensitivity=ignore) }} - - -{{! Prettier main (--html-whitespace-sensitivity=ignore) }} - -``` diff --git a/changelog_unreleased/handlebars/18133.md b/changelog_unreleased/handlebars/18133.md deleted file mode 100644 index 943cbdc12..000000000 --- a/changelog_unreleased/handlebars/18133.md +++ /dev/null @@ -1,14 +0,0 @@ -#### Don't force elements to break with `--html-whitespace-sensitivity=ignore` (#18133 by @fisker) - - -```hbs -{{! Input }} -
- -{{! Prettier stable (--html-whitespace-ensitivity=ignore) }} -
-
- -{{! Prettier main (--html-whitespace-ensitivity=ignore) }} -
-``` diff --git a/changelog_unreleased/html/17879.md b/changelog_unreleased/html/17879.md deleted file mode 100644 index 4374739ac..000000000 --- a/changelog_unreleased/html/17879.md +++ /dev/null @@ -1,22 +0,0 @@ -#### Support format `allow` attribute of iframe element (#17879 by @kovsu) - - -```html - - - - - - - - -``` diff --git a/changelog_unreleased/html/17909.md b/changelog_unreleased/html/17909.md deleted file mode 100644 index 88c5a5bcb..000000000 --- a/changelog_unreleased/html/17909.md +++ /dev/null @@ -1,26 +0,0 @@ -#### Format inline event handler (#17909 by @kovsu) - - -```html - - - - - - - - -``` diff --git a/changelog_unreleased/javascript/17329.md b/changelog_unreleased/javascript/17329.md deleted file mode 100644 index 434d8c569..000000000 --- a/changelog_unreleased/javascript/17329.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Allow break import attributes into multiple lines (#17329 by @fisker) - - -```jsx -// Input -import syntaxImportAssertions from "@babel/plugin-syntax-import-assertions" with { - BABEL_8_BREAKING: "false", - USE_ESM: "true", IS_STANDALONE: "false" }; - -// Prettier stable -import syntaxImportAssertions from "@babel/plugin-syntax-import-assertions" with { BABEL_8_BREAKING: "false", USE_ESM: "true", IS_STANDALONE: "false" }; - -// Prettier main -import syntaxImportAssertions from "@babel/plugin-syntax-import-assertions" with { - BABEL_8_BREAKING: "false", - USE_ESM: "true", - IS_STANDALONE: "false", -}; -``` diff --git a/changelog_unreleased/javascript/17708.md b/changelog_unreleased/javascript/17708.md deleted file mode 100644 index ba54e4524..000000000 --- a/changelog_unreleased/javascript/17708.md +++ /dev/null @@ -1,10 +0,0 @@ -#### Add support for "Discard Bindings" proposal (#17708 by @fisker) - -The Stage 2 proposal ["Discard Bindings"](https://github.com/tc39/proposal-discard-binding) is now supported via Babel. Also keep in mind our [policy on non-standardized syntax](https://prettier.io/docs/en/rationale.html#disclaimer-about-non-standard-syntax) before using this proposed syntax feature with Prettier. - - -```jsx -const [void] = x; - -const {x:void} = x; -``` diff --git a/changelog_unreleased/javascript/17723.md b/changelog_unreleased/javascript/17723.md deleted file mode 100644 index b06ca2ebb..000000000 --- a/changelog_unreleased/javascript/17723.md +++ /dev/null @@ -1,44 +0,0 @@ -#### Fix inconsistent comment format (#17723 by @fisker) - - -```jsx -// Input -if ( - true - // This is a really complicated part of the condition, so we need a big ol' - // comment here to explain it. - && flibble.blibble.blobble?.bloo -) { - doThings(); -} - -// Prettier stable (--parser=typescript --experimental-operator-position=start) -if ( - true - && // This is a really complicated part of the condition, so we need a big ol' - // comment here to explain it. - flibble.blibble.blobble?.bloo -) { - doThings(); -} - -// Prettier stable (--parser=babel --experimental-operator-position=start) -if ( - true - // This is a really complicated part of the condition, so we need a big ol' - // comment here to explain it. - && flibble.blibble.blobble?.bloo -) { - doThings(); -} - -// Prettier main -if ( - true - // This is a really complicated part of the condition, so we need a big ol' - // comment here to explain it. - && flibble.blibble.blobble?.bloo -) { - doThings(); -} -``` diff --git a/changelog_unreleased/javascript/17876.md b/changelog_unreleased/javascript/17876.md deleted file mode 100644 index fb80c2c53..000000000 --- a/changelog_unreleased/javascript/17876.md +++ /dev/null @@ -1,57 +0,0 @@ -#### Add additional Playwright test functions (#17876 by @BPScott) - -Prettier already avoids changing indentation for test functions when you add `.skip` to -them. It now also treats the Playwright functions [`test.fixme`](https://playwright.dev/docs/api/class-test#test-fixme), [`test.describe.skip`](https://playwright.dev/docs/api/class-test#test-describe-skip) and [`test.describe.fixme`](https://playwright.dev/docs/api/class-test#test-describe-fixme) similar to `test.skip`. - - -```js -// Input -test.fixme("does something really long and complicated so I have to write a very long name for the test", () => { - // code -}); - -test.describe.skip("does something really long and complicated so I have to write a very long name for the test", () => { - // code -}); - -test.describe.fixme("does something really long and complicated so I have to write a very long name for the test", () => { - // code -}); - -// Prettier stable -test.fixme( - "does something really long and complicated so I have to write a very long name for the test", - () => { - // code - }, -); - -test.describe.skip( - "does something really long and complicated so I have to write a very long name for the test", - () => { - // code - }, -); - -test.describe.fixme( - "does something really long and complicated so I have to write a very long name for the test", - () => { - // code - }, -); - -// Prettier main -test.fixme("does something really long and complicated so I have to write a very long name for the test", () => { - // code -}); - -test.describe - .skip("does something really long and complicated so I have to write a very long name for the test", () => { - // code -}); - -test.describe - .fixme("does something really long and complicated so I have to write a very long name for the test", () => { - // code -}); -``` diff --git a/changelog_unreleased/javascript/17882.md b/changelog_unreleased/javascript/17882.md deleted file mode 100644 index 8ef23474f..000000000 --- a/changelog_unreleased/javascript/17882.md +++ /dev/null @@ -1,40 +0,0 @@ -#### Avoid break `{import,require.resolve,require.resolve.paths,import.meta.resolve}()` with long module name (#17882, #17908 by @kovsu & @fisker) - - -```js -// Input -const a = require("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module"); -const b = require.resolve("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module"); -const c = require.resolve.paths("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module"); - -const d = await import("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module") -const e = import.meta.resolve("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module"); - -// Prettier stable -const a = require("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module"); -const b = require.resolve( - "./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module", -); -const c = require.resolve.paths( - "./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module", -); - -const d = await import( - "./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module" -); -const e = import.meta.resolve( - "./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module", -); - -// Prettier main -const a = require("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module"); -const b = - require.resolve("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module"); -const c = require.resolve - .paths("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module"); - -const d = - await import("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module"); -const e = import.meta - .resolve("./a/long/long/long/long/long/long/long/long/long/long/long/path/to/module"); -``` diff --git a/changelog_unreleased/javascript/17998.md b/changelog_unreleased/javascript/17998.md deleted file mode 100644 index 3132ce1c8..000000000 --- a/changelog_unreleased/javascript/17998.md +++ /dev/null @@ -1,31 +0,0 @@ -#### Improve comment handing inside if statement (#17998 by @fisker) - - -```jsx -// Input -if (foo) // comment -{ - doThing(); -} else // comment for else -{ - doSomethingElse(); -} - -// Prettier stable -if (foo) { - // comment - doThing(); -} // comment for else -else { - doSomethingElse(); -} - -// Prettier main -if (foo) // comment -{ - doThing(); -} else // comment for else -{ - doSomethingElse(); -} -``` diff --git a/changelog_unreleased/javascript/18037.md b/changelog_unreleased/javascript/18037.md deleted file mode 100644 index 4aa44d960..000000000 --- a/changelog_unreleased/javascript/18037.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Improve `require()` call with comments (#18037 by @fisker) - - -```jsx -// Input -require( -// Comment -"foo" -); - -// Prettier stable -require(// Comment -"foo"); - -// Prettier main -require( - // Comment - "foo", -); -``` diff --git a/changelog_unreleased/javascript/18087.md b/changelog_unreleased/javascript/18087.md deleted file mode 100644 index f148090a6..000000000 --- a/changelog_unreleased/javascript/18087.md +++ /dev/null @@ -1,42 +0,0 @@ -#### Remove indention in logical expression in `Boolean()` call (#18087 by @kovsu) - -Reduce diff when changing a condition to an opposite value, or change between `!!` and `Boolean()`. - - -```js -// Input -const foo = Boolean( - a_long_long_condition || - a_long_long_long_condition || - a_long_long_long_condition -); -const bar = !!( - a_long_long_condition || - a_long_long_long_condition || - a_long_long_long_condition -); - -// Prettier stable -const foo = Boolean( - a_long_long_condition || - a_long_long_long_condition || - a_long_long_long_condition, -); -const bar = !!( - a_long_long_condition || - a_long_long_long_condition || - a_long_long_long_condition -); - -// Prettier main -const foo = Boolean( - a_long_long_condition || - a_long_long_long_condition || - a_long_long_long_condition -); -const bar = !!( - a_long_long_condition || - a_long_long_long_condition || - a_long_long_long_condition -); -``` diff --git a/changelog_unreleased/javascript/18099.md b/changelog_unreleased/javascript/18099.md deleted file mode 100644 index 7e743e658..000000000 --- a/changelog_unreleased/javascript/18099.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Fix comments handling for for-statements (#18099 by @fisker, @sosukesuzuki) - - -```js -// Input -for (x of y) - // Comment - bar(); - -// Prettier stable -// Comment -for (x of y) bar(); - -// Prettier main -for (x of y) - // Comment - bar(); -``` diff --git a/changelog_unreleased/javascript/18108.md b/changelog_unreleased/javascript/18108.md deleted file mode 100644 index 05e03e671..000000000 --- a/changelog_unreleased/javascript/18108.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Improve comment printing around empty statement (#18108 by @fisker) - - -```jsx -// Input -for ( - index = 0; - doSomething(foo[index]) !== bar && doSomething(foo[index]) !== baz; - index ++ -) /* No op */; - -// Prettier stable -for ( - index = 0; - doSomething(foo[index]) !== bar && doSomething(foo[index]) !== baz; - index++ /* No op */ -); - -// Prettier main -for ( - index = 0; - doSomething(foo[index]) !== bar && doSomething(foo[index]) !== baz; - index++ -) /* No op */ ; -``` diff --git a/changelog_unreleased/javascript/18147.md b/changelog_unreleased/javascript/18147.md deleted file mode 100644 index c0d4440dd..000000000 --- a/changelog_unreleased/javascript/18147.md +++ /dev/null @@ -1,48 +0,0 @@ -#### Fix inconsistent comment print between class methods and object methods (#18147 by @fisker) - - -```jsx -// Input -class x { - method() // Class method - { - return 1 - } -} - -const object = { - method() // Object method - { - return 1 - } -} - -// Prettier stable -class x { - method() { // Class method - return 1; - } -} - -const object = { - method() { - // Object method - return 1; - }, -}; - -// Prettier main -class x { - method() { - // class method - return 1; - } -} - -const object = { - method() { - // object method - return 1; - }, -}; -``` diff --git a/changelog_unreleased/javascript/18163.md b/changelog_unreleased/javascript/18163.md deleted file mode 100644 index f5d5d055a..000000000 --- a/changelog_unreleased/javascript/18163.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Add missing parentheses in bitwise operators (#18163 by @fs0414) - - -```js -// Input -1 << (bit % 8); -1 >> (bit - 8); - -// Prettier stable -1 << bit % 8; -1 >> (bit - 8); - -// Prettier main -1 << (bit % 8); -1 >> (bit - 8); -``` diff --git a/changelog_unreleased/javascript/18172.md b/changelog_unreleased/javascript/18172.md deleted file mode 100644 index 89e94bf89..000000000 --- a/changelog_unreleased/javascript/18172.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Fix inconsistent break for array literals (#18172 by @Dunqing, @fisker) - - -```jsx -// Input -assert.deepStrictEqual(linesCollection.getViewLinesIndentGuides___(-1, -1), [1]); -assert.deepStrictEqual(linesCollection.getViewLinesIndentGuides(-1, -1), [1, 2]); - -// Prettier stable -assert.deepStrictEqual(linesCollection.getViewLinesIndentGuides___(-1, -1), [ - 1, -]); -assert.deepStrictEqual( - linesCollection.getViewLinesIndentGuides(-1, -1), - [1, 2], -); - -// Prettier main -assert.deepStrictEqual( - linesCollection.getViewLinesIndentGuides___(-1, -1), - [1], -); -assert.deepStrictEqual( - linesCollection.getViewLinesIndentGuides(-1, -1), - [1, 2], -); -``` diff --git a/changelog_unreleased/javascript/18205.md b/changelog_unreleased/javascript/18205.md deleted file mode 100644 index 89517f4bf..000000000 --- a/changelog_unreleased/javascript/18205.md +++ /dev/null @@ -1,49 +0,0 @@ -#### Fix inconsistent logical expression print (#18205 by @fisker) - - -```jsx -// Input -fn( - a && - a_long_long_long_long_long_long_long_long_long_long_long_long_long_condition - ? a - : b -); - -new Fn( - a && - a_long_long_long_long_long_long_long_long_long_long_long_long_long_condition - ? a - : b -); - -// Prettier stable -fn( - a && - a_long_long_long_long_long_long_long_long_long_long_long_long_long_condition - ? a - : b, -); - -new Fn( - a && - a_long_long_long_long_long_long_long_long_long_long_long_long_long_condition - ? a - : b, -); - -// Prettier main -fn( - a && - a_long_long_long_long_long_long_long_long_long_long_long_long_long_condition - ? a - : b, -); - -new Fn( - a && - a_long_long_long_long_long_long_long_long_long_long_long_long_long_condition - ? a - : b, -); -``` diff --git a/changelog_unreleased/javascript/18206.md b/changelog_unreleased/javascript/18206.md deleted file mode 100644 index 5168bb10c..000000000 --- a/changelog_unreleased/javascript/18206.md +++ /dev/null @@ -1,40 +0,0 @@ -#### Fix inconsistent print between `CallExpression` and `NewExpression` (#18206 by @fisker) - - -```jsx -// Input -TelemetryTrustedValue( - instance.capabilities.get( - TerminalCapability?.PromptTypeDetection - )?.promptType -) - -new TelemetryTrustedValue( - instance.capabilities.get( - TerminalCapability?.PromptTypeDetection - )?.promptType -) - -// Prettier stable -TelemetryTrustedValue( - instance.capabilities.get(TerminalCapability?.PromptTypeDetection) - ?.promptType, -); - -new TelemetryTrustedValue( - instance.capabilities.get( - TerminalCapability?.PromptTypeDetection, - )?.promptType, -); - -// Prettier main -TelemetryTrustedValue( - instance.capabilities.get(TerminalCapability?.PromptTypeDetection) - ?.promptType, -); - -new TelemetryTrustedValue( - instance.capabilities.get(TerminalCapability?.PromptTypeDetection) - ?.promptType, -) -``` diff --git a/changelog_unreleased/javascript/18243.md b/changelog_unreleased/javascript/18243.md deleted file mode 100644 index e690584b8..000000000 --- a/changelog_unreleased/javascript/18243.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Remove redundant parentheses around JSX element (#18243 by @fisker) - - -```jsx -// Input -new A( -
-
-
-) - -// Prettier stable -new A( - ( -
-
-
- ), -); - -// Prettier main -new A( -
-
-
, -); -``` diff --git a/changelog_unreleased/javascript/18245.md b/changelog_unreleased/javascript/18245.md deleted file mode 100644 index 1d005b65d..000000000 --- a/changelog_unreleased/javascript/18245.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Improve formatting of logical expression as callee of new expression (#18245 by @fisker) - - -```jsx -// Input -a = new ( - a_long_long_long_long_condition || a_long_long_long_long_condition || a_long_long_long_long_condition -)(); - -// Prettier stable -a = new (a_long_long_long_long_condition || - a_long_long_long_long_condition || - a_long_long_long_long_condition)(); - -// Prettier main -a = new ( - a_long_long_long_long_condition || - a_long_long_long_long_condition || - a_long_long_long_long_condition -)(); -``` diff --git a/changelog_unreleased/javascript/18300.md b/changelog_unreleased/javascript/18300.md deleted file mode 100644 index e38b7b8fb..000000000 --- a/changelog_unreleased/javascript/18300.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Remove empty line in for statement without "update" (#18300 by @fisker) - - -```jsx -// Input -for ( let i = 0, j = 0, len = allMatches.length, lenJ = selections.length;i < len;) {} - -// Prettier stable -for ( - let i = 0, j = 0, len = allMatches.length, lenJ = selections.length; - i < len; - -) {} - -// Prettier main -for ( - let i = 0, j = 0, len = allMatches.length, lenJ = selections.length; - i < len; -) {} -``` diff --git a/changelog_unreleased/javascript/18325.md b/changelog_unreleased/javascript/18325.md deleted file mode 100644 index 9fb15df3d..000000000 --- a/changelog_unreleased/javascript/18325.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Improve super class format (#18325 by @fisker) - - -```jsx -// Input -class EnsureNoDisposablesAreLeakedInTestSuiteSuite extends eslint.Rule.RuleModule {}; - -// Prettier stable -class EnsureNoDisposablesAreLeakedInTestSuiteSuite extends eslint.Rule - .RuleModule {} - -// Prettier main -class EnsureNoDisposablesAreLeakedInTestSuiteSuite - extends eslint.Rule.RuleModule {} -``` diff --git a/changelog_unreleased/less/17820.md b/changelog_unreleased/less/17820.md deleted file mode 100644 index 3cb7c79a3..000000000 --- a/changelog_unreleased/less/17820.md +++ /dev/null @@ -1,26 +0,0 @@ -#### Fix variable name being lowercased incorrectly (#17820 by @kovsu) - - -```less -// Input -@fooBackground:line-gradient(#f00); - -a { - background: @fooBackground; -} - -// Prettier stable -@foobackground:line-gradient (#f00); - -a { - background: @fooBackground; -} - - -// Prettier main -@fooBackground: line-gradient(#f00); - -a { - background: @fooBackground; -} -``` diff --git a/changelog_unreleased/less/17983.md b/changelog_unreleased/less/17983.md deleted file mode 100644 index 1f739ea3b..000000000 --- a/changelog_unreleased/less/17983.md +++ /dev/null @@ -1,31 +0,0 @@ -#### Keep property/variable accessors tight (#17983 by @kovsu) - - -```less -// Input -.average(@x, @y) { - @result: ((@x + @y) / 2); -} - -div { - padding: .average(16px, 50px) [ @result ]; -} - -// Prettier stable -.average(@x, @y) { - @result: ((@x + @y) / 2); -} - -div { - padding: .average(16px, 50px) [ @result]; -} - -// Prettier main -.average(@x, @y) { - @result: ((@x + @y) / 2); -} - -div { - padding: .average(16px, 50px)[@result]; -} -``` diff --git a/changelog_unreleased/markdown/17813.md b/changelog_unreleased/markdown/17813.md deleted file mode 100644 index 199a61cb1..000000000 --- a/changelog_unreleased/markdown/17813.md +++ /dev/null @@ -1,28 +0,0 @@ -#### Improve emoji size measurement (#17813 by @seiyab) - -This change improves table alignment in all languages. - - -```md - -| | | -| :-: | :-: | -| ✔ | ✘ | -| ✘ | ✔ | -| ✔ | ✘ | - - -| | | -| :-: | :-: | -| ✔ | ✘ | -| ✘ | ✔ | -| ✔ | ✘ | - - - -| | | -| :-: | :-: | -| ✔ | ✘ | -| ✘ | ✔ | -| ✔ | ✘ | -``` diff --git a/changelog_unreleased/markdown/17965.md b/changelog_unreleased/markdown/17965.md deleted file mode 100644 index ff641fd6e..000000000 --- a/changelog_unreleased/markdown/17965.md +++ /dev/null @@ -1,4 +0,0 @@ -#### Infer TOML parser for Front Matter (#17965 by @kovsu) - -TOML Front Matter can be processed by the appropriate plugin if any. -Works for HTML and CSS files too. diff --git a/changelog_unreleased/markdown/18010.md b/changelog_unreleased/markdown/18010.md deleted file mode 100644 index 8a67bd5d3..000000000 --- a/changelog_unreleased/markdown/18010.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Fix strong emphasis format (#18010 by @yin1999) - -This is a supplementary fix for #17143, where the original PR could not determine whether the contents on the left and right sides were both words. - - -```markdown - -1***2***3 -1**_2_**3 - - -1**_2_**3 -1**_2_**3 - - -1***2***3 -1***2***3 -``` diff --git a/changelog_unreleased/mdx/17996.md b/changelog_unreleased/mdx/17996.md deleted file mode 100644 index 371c82c87..000000000 --- a/changelog_unreleased/mdx/17996.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Fix `import` and `export` parsing (#17996 by @kovsu & @fisker) - - -```mdx -{/* Input */} -- import is a word in lists -- export is a word in lists, too! - -{/* Prettier stable */} -- import is a word in list - s -- export is a word in lists, too - ! - -{/* Prettier main */} -- import is a word in lists -- export is a word in lists, too! -``` diff --git a/changelog_unreleased/scss/17836.md b/changelog_unreleased/scss/17836.md deleted file mode 100644 index 3e101f581..000000000 --- a/changelog_unreleased/scss/17836.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Fix parentheses space problem in mixin argument (#17836 by @kovsu) - - -```scss -// Input -.foo { - @include bar('A (B)'); -} - -// Prettier stable -.foo { - @include bar('A( B)'); -} - -// Prettier main -.foo { - @include bar('A (B)'); -} -``` diff --git a/changelog_unreleased/scss/17903.md b/changelog_unreleased/scss/17903.md deleted file mode 100644 index f5681c67c..000000000 --- a/changelog_unreleased/scss/17903.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Fix formatting of space-separated values (#17903 by @kovsu) - - -```scss -// Input -.foo { - @include transition(min-height ($spacer/2) ease-in-out); -} - -// Prettier stable -.foo { - @include transition(min-height($spacer/2) ease-in-out); -} - -// Prettier main -.foo { - @include transition(min-height ($spacer/2) ease-in-out); -} -``` diff --git a/changelog_unreleased/typescript/17421.md b/changelog_unreleased/typescript/17421.md deleted file mode 100644 index 71bdcdfad..000000000 --- a/changelog_unreleased/typescript/17421.md +++ /dev/null @@ -1,30 +0,0 @@ -#### Fix misplacement of comments after arrow (#17421 by @o-m12a, @t-mangoe) - - -```ts -// Input -export const test = (): any => /* first line -second line -*/ - null; - -// Prettier stable -export const test = (): any /* first line -second line -*/ => null; - -// Prettier stable (Second format) -SyntaxError: Unexpected token (1:22) -> 1 | export const test = (): any /* first line - | ^ - 2 | second line - 3 | */ => null; - 4 | - -// Prettier main -export const test = (): any => - /* first line -second line -*/ - null; -``` diff --git a/changelog_unreleased/typescript/17724.md b/changelog_unreleased/typescript/17724.md deleted file mode 100644 index 6e4951d0b..000000000 --- a/changelog_unreleased/typescript/17724.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Add missing parentheses to arrow function in instantiation expression (#17724 by @fisker) - - -```tsx -// Input -void (<_T extends never>() => {}); - -// Prettier stable -void <_T extends never>() => {}; - -// Prettier main -void (<_T extends never>() => {}); -``` diff --git a/changelog_unreleased/typescript/17785.md b/changelog_unreleased/typescript/17785.md deleted file mode 100644 index 7b33d71d3..000000000 --- a/changelog_unreleased/typescript/17785.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Fix `TSMappedType` format (#17785 by @fisker) - - -```tsx -// Input (--parser=babel-ts) -export type A = B extends { C?: { [D in infer E]?: F } } ? G : H - -// Prettier stable -TypeError: Cannot read properties of undefined (reading 'startsWith') - -// Prettier main -export type A = B extends { C?: { [D in infer E]?: F } } ? G : H; -``` diff --git a/changelog_unreleased/typescript/17798.md b/changelog_unreleased/typescript/17798.md deleted file mode 100644 index d1aff05f6..000000000 --- a/changelog_unreleased/typescript/17798.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Print trailing comma in `TSImportType` options (#17798 by @fisker) - -Trailing comma in import type attribute wasn't allowed before TypeScript v5.9, now [the bug](https://github.com/microsoft/TypeScript/issues/61916) has been fixed. - - -```tsx -// Input -type A = import("foo", { - with:{ - type:'json', - } // <- Should be a comma here -}) - -// Prettier stable -type A = import("foo", { - with: { - type: "json", - } // <- Should be a comma here -}); - -// Prettier main -type A = import("foo", { - with: { - type: "json", - }, // <- Should be a comma here -}); -``` diff --git a/changelog_unreleased/typescript/18035.md b/changelog_unreleased/typescript/18035.md deleted file mode 100644 index 356f84530..000000000 --- a/changelog_unreleased/typescript/18035.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Improve CommonJS module `require()` with comments (#18035 by @fisker) - - -```tsx -// Input -import foo = require( -// Comment -"foo" -); - -// Prettier stable -import foo = require(// Comment -"foo"); - -// Prettier main -import foo = require( - // Comment - "foo" -); -``` diff --git a/changelog_unreleased/typescript/18043.md b/changelog_unreleased/typescript/18043.md deleted file mode 100644 index 6586b055d..000000000 --- a/changelog_unreleased/typescript/18043.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Line breaking after `=` in type parameters (#18043 by @fisker) - - -```tsx -// Input -export type OuterType2< - LongerLongerLongerLongerInnerType = LongerLongerLongerLongerLongerLongerLongerLongerOtherType -> = { a: 1 }; - -// Prettier stable -export type OuterType2< - LongerLongerLongerLongerInnerType = LongerLongerLongerLongerLongerLongerLongerLongerOtherType, -> = { a: 1 }; - -// Prettier main -export type OuterType2< - LongerLongerLongerLongerInnerType = - LongerLongerLongerLongerLongerLongerLongerLongerOtherType, -> = { a: 1 }; -``` diff --git a/changelog_unreleased/typescript/18094.md b/changelog_unreleased/typescript/18094.md deleted file mode 100644 index 14a42a2d9..000000000 --- a/changelog_unreleased/typescript/18094.md +++ /dev/null @@ -1,189 +0,0 @@ -#### [HIGHLIGHT] Fix the inconsistent printing between class and interface (#18094, #18091, #18215 by @fisker) - -In this release, we've focused heavily on improving consistency between Class and Interface formatting. Previously, these two similar constructs were printed quite differently, leading to visual inconsistencies. We've aligned their formatting rules to provide a more predictable and cleaner output. - -##### The extra indentation for type parameters in class has been removed - - -```tsx -// Input -interface MarkDef< - M extends string | Mark = Mark, - ES extends ExprRef | SignalRef = ExprRef | SignalRef, -> - extends A, B {} - -declare class MarkDef< - M extends string | Mark = Mark, - ES extends ExprRef | SignalRef = ExprRef | SignalRef, -> - implements A, B {} - -// Prettier stable -interface MarkDef< - M extends string | Mark = Mark, - ES extends ExprRef | SignalRef = ExprRef | SignalRef, -> extends A, - B {} - -declare class MarkDef< - M extends string | Mark = Mark, - ES extends ExprRef | SignalRef = ExprRef | SignalRef, - > - implements A, B {} - -// Prettier main -interface MarkDef< - M extends string | Mark = Mark, - ES extends ExprRef | SignalRef = ExprRef | SignalRef, -> - extends A, B {} - -declare class MarkDef< - M extends string | Mark = Mark, - ES extends ExprRef | SignalRef = ExprRef | SignalRef, -> - implements A, B {} -``` - -##### Align interface heritages print with class - - -```tsx -// Input -export interface AreaConfig - extends MarkConfig, PointOverlayMixins, LineOverlayMixins {} - -export class AreaConfig - implements MarkConfig, PointOverlayMixins, LineOverlayMixins {} - -// Prettier stable -export interface AreaConfig - extends MarkConfig, - PointOverlayMixins, - LineOverlayMixins {} - -export class AreaConfig - implements MarkConfig, PointOverlayMixins, LineOverlayMixins {} - -// Prettier main -export interface AreaConfig - extends MarkConfig, PointOverlayMixins, LineOverlayMixins {} - -export class AreaConfig - implements MarkConfig, PointOverlayMixins, LineOverlayMixins {} -``` - -##### Align single heritage print with super class - - -```tsx -// Input -class ExtendsLongOneWithGenerics - extends - Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine, - > {} -class ExtendsLongOneWithGenerics - implements - Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine, - > {} -interface ExtendsLongOneWithGenerics - extends - Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine, - > {} - -// Prettier stable -class ExtendsLongOneWithGenerics extends Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine -> {} -class ExtendsLongOneWithGenerics - implements - Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine - > {} -interface ExtendsLongOneWithGenerics - extends Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine - > {} - -// Prettier main -class ExtendsLongOneWithGenerics extends Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine -> {} -class ExtendsLongOneWithGenerics implements Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine -> {} -interface ExtendsLongOneWithGenerics extends Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine -> {} -``` - -##### Inconsistent opening brace print logic of class and interface body - -In Prettier v2.3, to improve visual separation between class head and body, [we start to print `{` of class body on a new line when the class has multiple heritages](https://prettier.io/blog/2021/05/09/2.3.0.html#improve-visual-separation-between-header-and-body-in-classes-with-multiline-headers-10085-by-sosukesuzuki). - - -```tsx -// Prettier 2.2 -class loooooooooooooooooooong - extends looooooooooooooooooong - implements loooooooooooooooooooong { - property: string; -} - -// Prettier 2.3 -class loooooooooooooooooooong - extends looooooooooooooooooong - implements loooooooooooooooooooong -{ - property: string; -} -``` - -However, not everyone is happy with this change. - -Let us know what you think about applying this change to interfaces, please leave a comment on [this issue](https://github.com/prettier/prettier/issues/18115). - -If you have a better solution for this issue, we'll be happy to discuss it too. - -Unless a better solution comes up, we'll align the interface body print with the one for the class body in Prettier v4. - - -```tsx -// Input -declare class loooooooooooooooooooong - implements looooooooooooooooooong, loooooooooooooooooooong { - property: string; -} - -interface loooooooooooooooooooong - extends looooooooooooooooooong, loooooooooooooooooooong { - property: string; -} - -// Prettier main -declare class loooooooooooooooooooong - implements looooooooooooooooooong, loooooooooooooooooooong -{ - property: string; -} - -interface loooooooooooooooooooong - extends looooooooooooooooooong, loooooooooooooooooooong { // <-- This - property: string; -} -``` - -_These changes also affect Flow syntax_ diff --git a/changelog_unreleased/typescript/18109.md b/changelog_unreleased/typescript/18109.md deleted file mode 100644 index 7a5974076..000000000 --- a/changelog_unreleased/typescript/18109.md +++ /dev/null @@ -1,34 +0,0 @@ -#### Remove unexpected blank line before union types (#18109 by @jspereiramoura, @fisker) - - -```tsx -// Input -type SuperLongTypeNameLoremIpsumLoremIpsumBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla = - Fooo1000 | Baz2000 | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; -type A = // comment - Fooo1000 | Baz2000 | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; - -// Prettier stable -type SuperLongTypeNameLoremIpsumLoremIpsumBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla = - - | Fooo1000 - | Baz2000 - | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; -type A = // comment - - | Fooo1000 - | Baz2000 - | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; - -// Prettier main -type SuperLongTypeNameLoremIpsumLoremIpsumBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla = - | Fooo1000 - | Baz2000 - | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; -type A = // comment - | Fooo1000 - | Baz2000 - | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; -``` - -_This change also affect Flow syntax_ diff --git a/changelog_unreleased/typescript/18110.md b/changelog_unreleased/typescript/18110.md deleted file mode 100644 index 881325835..000000000 --- a/changelog_unreleased/typescript/18110.md +++ /dev/null @@ -1,57 +0,0 @@ -#### Fix inconsistent comment printing between `typescript` and `flow` parser (#18110 by @fisker) - - -```tsx -// Input -interface A { - a: // Comment - B; - b: // Comment - | Fooo1000 - | Baz2000 - | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; - c: // Comment - & Fooo1000 - & Baz2000 - & BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; -} - -// Prettier stable (--parser=typescript) -interface A { - a: // Comment - B; - b: // Comment - | Fooo1000 - | Baz2000 - | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; - c: // Comment - Fooo1000 & - Baz2000 & - BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; -} - -// Prettier stable (--parser=flow) -interface A { - a: B; // Comment - b: // Comment - | Fooo1000 - | Baz2000 - | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; - c: Fooo1000 & // Comment - Baz2000 & - BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; -} - -// Prettier main (Same output for `--parser=typescript` and `--parser=flow`) -interface A { - a: B; // Comment - b: // Comment - | Fooo1000 - | Baz2000 - | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; - c: // Comment - Fooo1000 & - Baz2000 & - BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; -} -``` diff --git a/changelog_unreleased/typescript/18118.md b/changelog_unreleased/typescript/18118.md deleted file mode 100644 index 816c14480..000000000 --- a/changelog_unreleased/typescript/18118.md +++ /dev/null @@ -1,42 +0,0 @@ -#### Fix missing semicolon before call signatures (#18118 by @fisker) - - -```tsx -// Input -interface A { - foo; - (): T; -} -type B = { - foo; - (): T; -} - -// Prettier stable (--no-semi, first format) -interface A { - foo - (): T -} -type B = { - foo - (): T -} - -// Prettier stable (--no-semi, second format) -interface A { - foo(): T -} -type B = { - foo(): T -} - -// Prettier main -interface A { - foo; - (): T -} -type B = { - foo; - (): T -} -``` diff --git a/changelog_unreleased/typescript/18161.md b/changelog_unreleased/typescript/18161.md deleted file mode 100644 index 9b814a1bb..000000000 --- a/changelog_unreleased/typescript/18161.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Fix inconsistent print of `as const` between flow and typescript parsers (#18161 by @fisker) - - -```tsx -// Input -1 as /* comment */ const; - -// Prettier stable (--parser=typescript) -1 as /* comment */ const; - -// Prettier stable (--parser=flow) -1 /* comment */ as const; - -// Prettier main (Same output for `--parser=typescript` and `--parser=flow`) -1 /* comment */ as const; -``` diff --git a/changelog_unreleased/typescript/18162.md b/changelog_unreleased/typescript/18162.md deleted file mode 100644 index 7cb64c8c3..000000000 --- a/changelog_unreleased/typescript/18162.md +++ /dev/null @@ -1,28 +0,0 @@ -#### Fix comment around `as`/`satisfies` expression (#18162 by @fisker) - - -```tsx -// Input -1 as /* -comment -*/ -const; - -// Prettier stable (First format) -1 /* -comment -*/ as const; - -// Prettier stable (Second format) -SyntaxError: Unexpected keyword or identifier. (3:4) - 1 | 1 /* - 2 | comment -> 3 | */ as const; - | ^ - 4 | - -// Prettier main -1 as const /* -comment -*/; -``` diff --git a/changelog_unreleased/typescript/18165.md b/changelog_unreleased/typescript/18165.md deleted file mode 100644 index 53b9ebb7d..000000000 --- a/changelog_unreleased/typescript/18165.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Fix miss aligned union type (#18165 by @fisker) - - -```tsx -// Input -interface I { - elements: // comment - | [string, ExpressionNode, ExpressionNode] - | [string, ExpressionNode, ExpressionNode, ObjectExpression] -} - -// Prettier stable -interface I { - elements: // comment - | [string, ExpressionNode, ExpressionNode] - | [string, ExpressionNode, ExpressionNode, ObjectExpression]; -} - -// Prettier main -interface I { - elements: // comment - | [string, ExpressionNode, ExpressionNode] - | [string, ExpressionNode, ExpressionNode, ObjectExpression]; -} -``` diff --git a/changelog_unreleased/typescript/18197.md b/changelog_unreleased/typescript/18197.md deleted file mode 100644 index de33ceb8a..000000000 --- a/changelog_unreleased/typescript/18197.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Remove extra empty line in union type (#18197 by @Dunqing) - - -```tsx -// Input -type SuperLongTypeNameLoremIpsumLoremIpsumBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla = - Fooo1000 | Baz2000 | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; - -// Prettier stable -type SuperLongTypeNameLoremIpsumLoremIpsumBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla = - - | Fooo1000 - | Baz2000 - | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; - -// Prettier main -type SuperLongTypeNameLoremIpsumLoremIpsumBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla = - | Fooo1000 - | Baz2000 - | BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong; -``` diff --git a/changelog_unreleased/yaml/17843.md b/changelog_unreleased/yaml/17843.md deleted file mode 100644 index 53212ea2e..000000000 --- a/changelog_unreleased/yaml/17843.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Preserve empty line between map and comment (#17843 by @kovsu) - - -```yaml -# Input -only: issues - -# Comment - -# Prettier stable -only: issues -# Comment - -# Prettier main -only: issues - -# Comment -``` diff --git a/changelog_unreleased/yaml/18296.md b/changelog_unreleased/yaml/18296.md deleted file mode 100644 index e3c252997..000000000 --- a/changelog_unreleased/yaml/18296.md +++ /dev/null @@ -1,33 +0,0 @@ -#### Preserve explicit document end marker (#18296 by @fisker) - - -```yaml -# Input -a: a ---- -b: b -... -c: c -... ---- -d: d - -# Prettier stable -a: a ---- -b: b ---- -c: c ---- -d: d - -# Prettier main -a: a ---- -b: b -... -c: c -... ---- -d: d -``` diff --git a/changelog_unreleased/yaml/18324.md b/changelog_unreleased/yaml/18324.md deleted file mode 100644 index 1736d6afc..000000000 --- a/changelog_unreleased/yaml/18324.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Use explicit key style for flow-mapping keys with trailing comments (#18324 by @kovsu, @fisker) - - -```yaml -# Input -{ "foo" # comment - :bar } - -# Prettier stable -{ "foo": bar } # comment - -# Prettier main -{ ? "foo" # comment - : bar } -```