diff --git a/changelog_unreleased/angular/19431.md b/changelog_unreleased/angular/19431.md deleted file mode 100644 index e4875bba5..000000000 --- a/changelog_unreleased/angular/19431.md +++ /dev/null @@ -1,29 +0,0 @@ -#### Support `@content` block (#19431 by @fisker) - - -```html - - - @content(icon) { - Icon - } - @content(description) { - Description text - } - Other children - - - -SyntaxError: Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.) (9:15) - - - - @content(icon) { - Icon! - } - @content(description) { - Description text - } - Other children - -``` diff --git a/changelog_unreleased/angular/19465.md b/changelog_unreleased/angular/19465.md deleted file mode 100644 index fd6685017..000000000 --- a/changelog_unreleased/angular/19465.md +++ /dev/null @@ -1,31 +0,0 @@ -#### Support comments in html element (#19465 by @fisker) - - -```html - -
- - -
- - -
-``` diff --git a/changelog_unreleased/blog-post-intro.md b/changelog_unreleased/blog-post-intro.md deleted file mode 100644 index 6591cf8dc..000000000 --- a/changelog_unreleased/blog-post-intro.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -authors: "fisker" -title: "Prettier 3.9: New Parser Foundations and Formatting Improvements" ---- - -We are excited to announce Prettier 3.9! - -This release brings major parser upgrades for Markdown, YAML, Flow, GraphQL, and Angular, along with formatting improvements for JavaScript and TypeScript (particularly in `--no-semi` mode). - -If you find Prettier valuable, please consider [sponsoring us on OpenCollective](https://opencollective.com/prettier) or supporting the upstream projects we rely on. Your contributions help us keep improving the tool for everyone. - -Thank you for your continued support! ❀️ - -A reminder, when Prettier is installed or updated, it’s [strongly recommended](https://prettier.io/docs/install#summary) to specify the exact version in `package.json`: `"prettier": "3.9.0"`, not `"prettier": "^3.9.0"`. - -If you use [`@prettier/plugin-oxc`](https://www.npmjs.com/package/@prettier/plugin-oxc) or [`@prettier/plugin-hermes`](https://www.npmjs.com/package/@prettier/plugin-hermes), don't forget upgrade them to ensure the new formatting rules are applied. - - diff --git a/changelog_unreleased/cli/18452.md b/changelog_unreleased/cli/18452.md deleted file mode 100644 index c73c6aa5c..000000000 --- a/changelog_unreleased/cli/18452.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Fix crashes on formatting directory names that have special characters (#18452 by @fisker) - - -```sh -prettier . --check - -# Prettier stable -[error] Invalid configuration for file "\test\username[repo-name]\.editorconfig": -[error] Invalid regular expression: /^(?=.)username[repo-name]$/: Range out of order in character class - -# Prettier main -Checking formatting... -[warn] test/username[repo-name]/test.js -[warn] Code style issues found in the above file. Run Prettier with --write to fix. -``` diff --git a/changelog_unreleased/cli/18891.md b/changelog_unreleased/cli/18891.md deleted file mode 100644 index f43bb8849..000000000 --- a/changelog_unreleased/cli/18891.md +++ /dev/null @@ -1,3 +0,0 @@ -#### Stop searching for EditorConfig files above Git worktrees (#18891 by @seiyab) - -Prettier now treats a `.git` file as a project root marker, in addition to a `.git` directory. This prevents EditorConfig settings from a parent directory from being applied when formatting files inside Git worktrees or submodules. diff --git a/changelog_unreleased/cli/18914.md b/changelog_unreleased/cli/18914.md deleted file mode 100644 index a9a856e9d..000000000 --- a/changelog_unreleased/cli/18914.md +++ /dev/null @@ -1,3 +0,0 @@ -#### Fix `--cache-strategy content` not working (#18914 by @paulofduarte) - -`file-entry-cache` v11 renamed the `useChecksum` option to `useCheckSum`. Prettier was still passing the old casing, so content-based cache comparison was silently disabled and only file size was compared. diff --git a/changelog_unreleased/cli/19315.md b/changelog_unreleased/cli/19315.md deleted file mode 100644 index beb51489e..000000000 --- a/changelog_unreleased/cli/19315.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Fix formatting file with a leading quote (`"`) in the name (#19315 by @kovsu) - - -```console -prettier --check '".md' - -# Prettier stable -Checking formatting... -[error] Explicitly specified file was ignored due to negative glob patterns: "".md". - -# Prettier main -Checking formatting... -[warn] ".md -[warn] Code style issues found in the above file. Run Prettier with --write to fix. -``` diff --git a/changelog_unreleased/cli/19381.md b/changelog_unreleased/cli/19381.md deleted file mode 100644 index 152b65e18..000000000 --- a/changelog_unreleased/cli/19381.md +++ /dev/null @@ -1,6 +0,0 @@ -#### Update experimental cli (#19381, #19415 by @Simomson, @43081j, @fisker) - -Full changelog: - -- [v0.11.0](https://github.com/prettier/prettier-cli/releases/tag/v0.11.0) -- [v0.12.0](https://github.com/prettier/prettier-cli/releases/tag/v0.12.0) diff --git a/changelog_unreleased/css/18605.md b/changelog_unreleased/css/18605.md deleted file mode 100644 index 6d5e6fd2d..000000000 --- a/changelog_unreleased/css/18605.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Fix line breaks when css attribute values contain literal newlines (#18605 by @kovsu) - - -```css -/* Input */ -div span[foo="a long long long long long long long long\ -long long long long attritbute value"] { -} - -/* Prettier stable */ -div - span[foo="a long long long long long long long long\ -long long long long attritbute value"] { -} - -/* Prettier main */ -div span[foo="a long long long long long long long long\ -long long long long attritbute value"] { -} -``` diff --git a/changelog_unreleased/flow/11004.md b/changelog_unreleased/flow/11004.md deleted file mode 100644 index 373ab9a4a..000000000 --- a/changelog_unreleased/flow/11004.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Fix parenthesis for optional function as return type (#11004, #19331 by @vjeux, @fisker) - - -```jsx -// Input -const fn = (a: number): ?((string) => string) => { - return a > 0 ? (s) => `${s}: ${a}` : null; -}; - -// Prettier stable -const fn = (a: number): ?(string) => string => { - return a > 0 ? (s) => `${s}: ${a}` : null; -}; - -// Prettier main -const fn = (a: number): ?((string) => string) => { - return a > 0 ? (s) => `${s}: ${a}` : null; -}; -``` diff --git a/changelog_unreleased/flow/18511.md b/changelog_unreleased/flow/18511.md deleted file mode 100644 index 0705cc8e7..000000000 --- a/changelog_unreleased/flow/18511.md +++ /dev/null @@ -1,23 +0,0 @@ -#### Add support for Flow match instance patterns and Flow records (#18511 by @gkz) - - -```flow -// Input -record R { - num: number, -} - -const x = R {num: 1}; - -const label = match (x) { - R {num: 0} => "zero", - R {num: 1} => "one", - R {const num} => `${num} items`, -} - -// Prettier stable -// Unsupported - -// Prettier main -// Same as input -``` diff --git a/changelog_unreleased/flow/18616.md b/changelog_unreleased/flow/18616.md deleted file mode 100644 index efc7f527a..000000000 --- a/changelog_unreleased/flow/18616.md +++ /dev/null @@ -1,23 +0,0 @@ -#### Improve comment format in inexact tuples (#18616 by @fisker) - - -```flow -// Input -type A = [// comment -...]; -type B = [/* comment */...]; - -// Prettier stable -type A = [... - // comment -]; -type B = [... - /* comment */ -]; - -// Prettier main -type A = [ - ...// comment -]; -type B = [.../* comment */]; -``` diff --git a/changelog_unreleased/flow/18629.md b/changelog_unreleased/flow/18629.md deleted file mode 100644 index 0e297a9e2..000000000 --- a/changelog_unreleased/flow/18629.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Fix dangling comment print in components (#18629 by @fisker) - - -```flow -// Input -component A( - // comment -) {} -component B(/* comment */) {} - -// Prettier stable -component A() // comment -{} -component B /* comment */() {} - -// Prettier main -component A( - // comment -) {} -component B(/* comment */) {} -``` diff --git a/changelog_unreleased/flow/18630.md b/changelog_unreleased/flow/18630.md deleted file mode 100644 index 0ebc9e730..000000000 --- a/changelog_unreleased/flow/18630.md +++ /dev/null @@ -1,32 +0,0 @@ -#### Fix dangling comment print in hooks (#18630 by @fisker) - - -```flow -// Input -hook A( - // comment -) {} -declare hook B(// comment - ): void -type C = hook (// comment -)=> void - -// Prettier stable -hook A() // comment -{} -declare hook B(): // comment -void; -type C = hook () => // comment -void; - -// Prettier main -hook A( - // comment -) {} -declare hook B( - // comment -): void; -type C = hook ( - // comment -) => void; -``` diff --git a/changelog_unreleased/flow/18690.md b/changelog_unreleased/flow/18690.md deleted file mode 100644 index cc75a345c..000000000 --- a/changelog_unreleased/flow/18690.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Support implicit declared functions and components (#18690 by @fisker) - - -```flow -// Input -declare module "foo" { - function greet(name: string): string; - component Button(label: string); -} - -// Prettier stable -SyntaxError: Unexpected token `;`, expected the token `{` (2:39) - -// Prettier main - -``` diff --git a/changelog_unreleased/flow/18779.md b/changelog_unreleased/flow/18779.md deleted file mode 100644 index 26d58bfbd..000000000 --- a/changelog_unreleased/flow/18779.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Improve long mapped type to across multiple line (#18779 by @kovsu) - - -```flow -// Input -type MappedType = { - [KeyType in ValueType extends string ? VeryLongStringTypeNameHere : VeryLongNumberTypeNameHere]: KeyType -} - -// Prettier stable -type MappedType = { - [KeyType in ValueType extends string - ? VeryLongStringTypeNameHere - : VeryLongNumberTypeNameHere]: KeyType, -}; - -// Prettier main -type MappedType = { - [ - KeyType in ValueType extends string - ? VeryLongStringTypeNameHere - : VeryLongNumberTypeNameHere - ]: KeyType, -}; -``` diff --git a/changelog_unreleased/flow/18801.md b/changelog_unreleased/flow/18801.md deleted file mode 100644 index bbff1cc36..000000000 --- a/changelog_unreleased/flow/18801.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Add parentheses support for `keyof` type operator (#18801 by @marcoww6) - - -```flow -// Input -type T1 = (keyof Foo)[]; -type T2 = (keyof Foo)["bar"]; - -// Prettier stable -type T1 = keyof Foo[]; -type T2 = keyof Foo["bar"]; - -// Prettier main -type T1 = (keyof Foo)[]; -type T2 = (keyof Foo)["bar"]; -``` diff --git a/changelog_unreleased/flow/18929.md b/changelog_unreleased/flow/18929.md deleted file mode 100644 index 4535580ef..000000000 --- a/changelog_unreleased/flow/18929.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Support literal initializers and multiple declarations in `DeclareVariable` (#18929 by @fisker) - - -```flow -// Input -declare const x: string, y: number; -declare const s = 'foo'; - -// Prettier stable -SyntaxError: Unexpected token `,`, expected the token `;` (1:24) - -// Prettier main -declare const x: string, y: number; -declare const s = "foo"; -``` diff --git a/changelog_unreleased/flow/19053.md b/changelog_unreleased/flow/19053.md deleted file mode 100644 index bd5b4e806..000000000 --- a/changelog_unreleased/flow/19053.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Print `async` keyword for component declarations (#19053 by @mvitousek) - - -```flow -// Input -async component MyAsyncComponent() {} - -// Prettier stable -component MyAsyncComponent() {} - -// Prettier main -async component MyAsyncComponent() {} -``` diff --git a/changelog_unreleased/flow/19102.md b/changelog_unreleased/flow/19102.md deleted file mode 100644 index 510ffb64d..000000000 --- a/changelog_unreleased/flow/19102.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Add support for `writeonly`, `in`, and `out` variance modifiers (#19102 by @marcoww6) - -Support new Flow variance syntax: `writeonly` on object type properties/indexers, and `in T`/`out T` on type parameters. - - -```jsx -// Input -type T = {writeonly foo: string}; -type Contravariant = T; -type Covariant = T; - -// Prettier stable -// SyntaxError - -// Prettier main -type T = { writeonly foo: string }; -type Contravariant = T; -type Covariant = T; -``` diff --git a/changelog_unreleased/flow/19287.md b/changelog_unreleased/flow/19287.md deleted file mode 100644 index 176fc5bae..000000000 --- a/changelog_unreleased/flow/19287.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Do not expand object type with inline comments (#19287 by @fisker) - - -```flow -// Input -type T = {|/* comment */|}; - -// Prettier stable -type T = {| - /* comment */ -|}; - -// Prettier main -type T = {| /* comment */ |}; -``` diff --git a/changelog_unreleased/flow/19398-2.md b/changelog_unreleased/flow/19398-2.md deleted file mode 100644 index e736fe6ab..000000000 --- a/changelog_unreleased/flow/19398-2.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Preserve Flow comment syntax (#19398 by @SamChou19815) - -Preserves Flow comment syntax annotations instead of printing them as regular Flow syntax. - - -```flow -// Input -function foo(bar /*: T[] */, baz /*: T */) /*: S */ {} - -// Prettier stable -function foo(bar: T[], baz: T): S {} - -// Prettier main -function foo(bar /*: T[] */, baz /*: T */) /*: S */ {} -``` diff --git a/changelog_unreleased/flow/19398.md b/changelog_unreleased/flow/19398.md deleted file mode 100644 index 18add539a..000000000 --- a/changelog_unreleased/flow/19398.md +++ /dev/null @@ -1,5 +0,0 @@ -#### [HIGHLIGHT] New Rust-based Flow parser (#19398 by @SamChou19815) - -Prettier now uses the new Rust-based Flow parser (oxidized) released by the Flow team, which improves performance for Flow-typed code. - -In local parser-only benchmarks, `flow-parser/oxidized` parsed Prettier's valid Flow fixtures in 266.4ms median time, compared with 422.6ms for the old parser, and parsed `flow_parser.js` in 1298.0ms, compared with 2269.6ms. diff --git a/changelog_unreleased/graphql/18581.md b/changelog_unreleased/graphql/18581.md deleted file mode 100644 index e2d331681..000000000 --- a/changelog_unreleased/graphql/18581.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Fix crash with comment only object value (#18581 by @fisker) - - -```gql -# Input -query { - search(filters: { - # TODO - }) { - id - } -} - -# Prettier stable -Error: Comment "TODO" was not printed. Please report this error! - -# Prettier main -query { - search( - filters: { - # TODO - } - ) { - id - } -} -``` diff --git a/changelog_unreleased/graphql/18582.md b/changelog_unreleased/graphql/18582.md deleted file mode 100644 index 7d35225a4..000000000 --- a/changelog_unreleased/graphql/18582.md +++ /dev/null @@ -1,24 +0,0 @@ -#### Allow interfaces to break (#18582 by @fisker) - - -```gql -# Input -type Foo implements InterfaceOne & InterfaceTwo & InterfaceThree & InterfaceFour & InterfaceFive & InterfaceSix { - id: ID! -} - -# Prettier stable -type Foo implements InterfaceOne & InterfaceTwo & InterfaceThree & InterfaceFour & InterfaceFive & InterfaceSix { - id: ID! -} - -# Prettier main -type Foo implements InterfaceOne & - InterfaceTwo & - InterfaceThree & - InterfaceFour & - InterfaceFive & - InterfaceSix { - id: ID! -} -``` diff --git a/changelog_unreleased/graphql/19297.md b/changelog_unreleased/graphql/19297.md deleted file mode 100644 index bb547e579..000000000 --- a/changelog_unreleased/graphql/19297.md +++ /dev/null @@ -1,37 +0,0 @@ -#### [HIGHLIGHT] Support GraphQL.js v17 (#19171 by @YBJ0000, #19297 by @fisker) - -Prettier now fully supports newer syntax features from GraphQL.js v17, including directives on directive definitions, fragment arguments, and other enhancements. - -[Fragment arguments](https://github.com/graphql/graphql-js/pull/4015) - - -```gql -# Input -fragment variableProfilePic on User { - ...dynamicProfilePic(size: $size) -} - -# Prettier stable -SyntaxError: Syntax Error: Expected Name, found "(". (2:23) - -# Prettier main -fragment variableProfilePic on User { - ...dynamicProfilePic(size: $size) -} -``` - -[Directives on directive definitions](https://github.com/graphql/graphql-js/pull/4521) (and `extend directive` extensions) - - -```gql -# Input -directive @a @b on QUERY -extend directive @a @b - -# Prettier stable -Error: Syntax Error: Expected "on", found "@". - -# Prettier main -directive @a @b on QUERY -extend directive @a @b -``` diff --git a/changelog_unreleased/graphql/19422.md b/changelog_unreleased/graphql/19422.md deleted file mode 100644 index b8d3b6b80..000000000 --- a/changelog_unreleased/graphql/19422.md +++ /dev/null @@ -1,23 +0,0 @@ -#### Fix crash with comment only list value (#19422 by @fisker) - - -```gql -# Input -query { - a(x: [ - # only comment - ]) -} - -# Prettier stable -Error: Comment "only comment" was not printed. Please report this error! - -# Prettier main -query { - a( - x: [ - # only comment - ] - ) -} -``` diff --git a/changelog_unreleased/html/18453.md b/changelog_unreleased/html/18453.md deleted file mode 100644 index bb1e4f0d1..000000000 --- a/changelog_unreleased/html/18453.md +++ /dev/null @@ -1,26 +0,0 @@ -#### Fix a bug around unicode in front matter (#18453 by @seiyab) - - -```html - ---- -title: πŸ˜„ ---- - - - - ---- -title: πŸ˜„ ---- - - - ---- -title: πŸ˜„ ---- - - -``` diff --git a/changelog_unreleased/html/19046.md b/changelog_unreleased/html/19046.md deleted file mode 100644 index cfddbf83a..000000000 --- a/changelog_unreleased/html/19046.md +++ /dev/null @@ -1,26 +0,0 @@ -#### Fix closing tag of pre-like elements being split across lines (#19046 by @kovsu) - - -```html - -
-
-  Content
-
-
- - -
-
-  Content
-
-
- - -
-
-  Content
-
-
-``` diff --git a/changelog_unreleased/html/19304.md b/changelog_unreleased/html/19304.md deleted file mode 100644 index aa83a9385..000000000 --- a/changelog_unreleased/html/19304.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Keep an inline comment attached to the preceding node (#19304 by @kovsu) - - -```html - -

x

- - -

- x -

- - -

x

-``` diff --git a/changelog_unreleased/javascript/18142.md b/changelog_unreleased/javascript/18142.md deleted file mode 100644 index 77c2861f8..000000000 --- a/changelog_unreleased/javascript/18142.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Remove redundant parentheses in "return statement" (#18142 by @fisker) - - -```jsx -// Input -function sequenceExpressionInside() { - return ( // Reason for a - a, b - ); -} - -// Prettier stable -function sequenceExpressionInside() { - return ( - // Reason for a - (a, b) - ); -} - -// Prettier main -function sequenceExpressionInside() { - return ( - // Reason for a - a, b - ); -} -``` diff --git a/changelog_unreleased/javascript/18380-2.md b/changelog_unreleased/javascript/18380-2.md deleted file mode 100644 index 7419a5e75..000000000 --- a/changelog_unreleased/javascript/18380-2.md +++ /dev/null @@ -1,56 +0,0 @@ -#### Fix alignment in embedded template interpolations (#18380 by @fisker) - - -```jsx -// Input -string = ` - .class { - flex-direction: column${ - long_cond && long_cond && long_cond - ? "-reverse" : - "" - }; - } -`; -css = css` - .class { - flex-direction: column${ - long_cond && long_cond && long_cond - ? "-reverse" : - "" - }; - } -`; - -// Prettier stable -string = ` - .class { - flex-direction: column${ - long_cond && long_cond && long_cond ? "-reverse" : "" - }; - } -`; -css = css` - .class { - flex-direction: column${long_cond && long_cond && long_cond - ? "-reverse" - : ""}; - } -`; - -// Prettier main -string = ` - .class { - flex-direction: column${ - long_cond && long_cond && long_cond ? "-reverse" : "" - }; - } -`; -css = css` - .class { - flex-direction: column${ - long_cond && long_cond && long_cond ? "-reverse" : "" - }; - } -`; -``` diff --git a/changelog_unreleased/javascript/18380.md b/changelog_unreleased/javascript/18380.md deleted file mode 100644 index ea7c43f5d..000000000 --- a/changelog_unreleased/javascript/18380.md +++ /dev/null @@ -1,34 +0,0 @@ -#### Avoid linebreaks in embedded template interpolations (#18380 by @fisker) - - -```jsx -// Input -string = /* Comment */ ` -
${long_cond && long_cond && long_cond && long_cond && long_cond ? "content" : ""}
-`; -html = /* HTML */ ` -
${long_cond && long_cond && long_cond && long_cond && long_cond ? "content" : ""}
-`; - -// Prettier stable -string = /* Comment */ ` -
${long_cond && long_cond && long_cond && long_cond && long_cond ? "content" : ""}
-`; -html = /* HTML */ ` -
- ${long_cond && long_cond && long_cond && long_cond && long_cond - ? "content" - : ""} -
-`; - -// Prettier main -string = /* Comment */ ` -
${long_cond && long_cond && long_cond && long_cond && long_cond ? "content" : ""}
-`; -html = /* HTML */ ` -
- ${long_cond && long_cond && long_cond && long_cond && long_cond ? "content" : ""} -
-`; -``` diff --git a/changelog_unreleased/javascript/18397.md b/changelog_unreleased/javascript/18397.md deleted file mode 100644 index 952bd7561..000000000 --- a/changelog_unreleased/javascript/18397.md +++ /dev/null @@ -1,58 +0,0 @@ -#### Improve logical not expression print (#18397, #18401 by @fisker) - -- Fixed inner logical expression can be double parenthesized in some case. -- Inline the expression in `if`/`while`/`do..while` condition, to reduce diff when changing condition to negated value. - - -```jsx -// Input -if (!( - // `import("foo")` - node.type === "ImportExpression" || - // `type foo = import("foo")` - node.type === "TSImportType" -)) { -} else if ( - // `import("foo")` - node.type === "ImportExpression" || - // `type foo = import("foo")` - node.type === "TSImportType" -) { -} - -// Prettier stable -if ( - !( - // `import("foo")` - ( - node.type === "ImportExpression" || - // `type foo = import("foo")` - node.type === "TSImportType" - ) - ) -) { -} else if ( - // `import("foo")` - node.type === "ImportExpression" || - // `type foo = import("foo")` - node.type === "TSImportType" -) { -} - -// Prettier main -if (!( - // `import("foo")` - node.type === "ImportExpression" || - // `type foo = import("foo")` - node.type === "TSImportType" -)) { -} else if ( - // `import("foo")` - node.type === "ImportExpression" || - // `type foo = import("foo")` - node.type === "TSImportType" -) { -} -``` - -_This code example above is [a real world case](https://github.com/prettier/prettier/blob/edb53db4b1ec326d3f0f4fb683f56c83beefeba4/src/language-js/print/call-expression.js#L135-L155) right here in the Prettier codebase_ diff --git a/changelog_unreleased/javascript/18460.md b/changelog_unreleased/javascript/18460.md deleted file mode 100644 index 562557cce..000000000 --- a/changelog_unreleased/javascript/18460.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Remove unexpected space inserted before expression in CSS selectors (#18460 by @kovsu) - - -```js -// Input -css`foo:${bar} {}` - -// Prettier stable -css` - foo: ${bar} { - - } -`; - -// Prettier main -css` - foo:${bar} { - } -`; -``` diff --git a/changelog_unreleased/javascript/18538.md b/changelog_unreleased/javascript/18538.md deleted file mode 100644 index 1851f6a19..000000000 --- a/changelog_unreleased/javascript/18538.md +++ /dev/null @@ -1,35 +0,0 @@ -#### Keep iife function comments in parentheses (#18538 by @fisker) - - -```jsx -// Input -const a = ( - /** - * @param {number} foo - * @return {number} - */ - function (foo) { - return foo + 1; - } -)(1); - -// Prettier stable -const a = /** - * @param {number} foo - * @return {number} - */ -(function (foo) { - return foo + 1; -})(1); - -// Prettier main -const a = ( - /** - * @param {number} foo - * @return {number} - */ - function (foo) { - return foo + 1; - } -)(1); -``` diff --git a/changelog_unreleased/javascript/18540.md b/changelog_unreleased/javascript/18540.md deleted file mode 100644 index d49d999a2..000000000 --- a/changelog_unreleased/javascript/18540.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Fix comment print for parenthesized callee (#18540 by @fisker) - - -```jsx -// Input -const a = ( - function(){} - /* comment for callee */ - )(), - b = ( - function(){} - )(/* comment for call */) - -// Prettier stable -const a = (function () {})(), - /* comment for callee */ - b = (function () {})(/* comment for call */); - -// Prettier main -const a = ( - function () {} - /* comment for callee */ - )(), - b = (function () {})(/* comment for call */); -``` diff --git a/changelog_unreleased/javascript/18594.md b/changelog_unreleased/javascript/18594.md deleted file mode 100644 index 46b9af142..000000000 --- a/changelog_unreleased/javascript/18594.md +++ /dev/null @@ -1,14 +0,0 @@ -#### Preserve trailing double spaces in JSDoc (#18594 by @seiyab) - -Some tools treat these spaces as meaningful. - -```js -await prettier.format("/**\n * With 2 spaces \n */", { parser: "babel" }); - -/* Prettier stable */ -// -> '/**\n * With 2 spaces\n */\n' - -/* Prettier main */ -// -> '/**\n * With 2 spaces \n */\n' -// ^^ space preserved -``` diff --git a/changelog_unreleased/javascript/18611.md b/changelog_unreleased/javascript/18611.md deleted file mode 100644 index b36912ace..000000000 --- a/changelog_unreleased/javascript/18611.md +++ /dev/null @@ -1,23 +0,0 @@ -#### Drop support for the old "import assertions" syntax (#18611 by @fisker) - -`import assertions` (using the `assert` keyword) is an old version of the current [import attributes proposal](https://github.com/tc39/proposal-import-attributes). - -```js -// Old (deprecated) -import foo from "./foo.json" assert { type: "json" }; - -// Current standard -import foo from "./foo.json" with { type: "json" }; -``` - -Babel 8 completely removed support for the legacy `assert` syntax (the old parser plugin is gone). -Without Babel parser support, Prettier can no longer reliably parse or format code using `import ... assert { ... }`. - -Please migrate to the `with` syntax. - -```diff -- import foo from "./foo.json" assert { type: "json" }; -+ import foo from "./foo.json" with { type: "json" }; -``` - -See also Prettier's [disclaimer about non-standard syntax](https://prettier.io/docs/rationale.html#disclaimer-about-non-standard-syntax). diff --git a/changelog_unreleased/javascript/18615-2.md b/changelog_unreleased/javascript/18615-2.md deleted file mode 100644 index e79990344..000000000 --- a/changelog_unreleased/javascript/18615-2.md +++ /dev/null @@ -1,53 +0,0 @@ -#### Improve comment handling around empty call argument list (#18615 by @fisker) - - -```jsx -// Input -call -// line comment -(); -call(// line comment -); -call( - // line comment -); - -call -/* block comment */ -(); -call(/* block comment */ -); -call( - /* block comment */ -); - -// Prettier stable -call(); -// line comment -call(); // line comment -call(); -// line comment - -call(); -/* block comment */ -call /* block comment */(); -call(); -/* block comment */ - -// Prettier main -call -// line comment -(); -call( - // line comment -); -call( - // line comment -); - -call -/* block comment */ -(); -call(/* block comment */); -call(/* block comment */); -``` diff --git a/changelog_unreleased/javascript/18615-3.md b/changelog_unreleased/javascript/18615-3.md deleted file mode 100644 index 33379c67b..000000000 --- a/changelog_unreleased/javascript/18615-3.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Fix unstable comment in call expression (#18615 by @fisker) - - -```jsx -// Input -foo = - call( - /* call argument */); - -// Prettier stable (First format) -foo = - call(); - /* call argument */ - -// Prettier stable (Second format) -foo = call(); -/* call argument */ - -// Prettier main -foo = call(/* call argument */); -``` diff --git a/changelog_unreleased/javascript/18615.md b/changelog_unreleased/javascript/18615.md deleted file mode 100644 index b650a00d6..000000000 --- a/changelog_unreleased/javascript/18615.md +++ /dev/null @@ -1,29 +0,0 @@ -#### Allow empty call expression argument list with long comments to break (#18615 by @fisker) - - -```jsx -// Input -call(/* a long long long long long long long long long long long long comment */); -array = [/* a long long long long long long long long long long long long comment */]; -object = {/* a long long long long long long long long long long long long comment */}; - -// Prettier stable -call(/* a long long long long long long long long long long long long comment */); -array = [ - /* a long long long long long long long long long long long long comment */ -]; -object = { - /* a long long long long long long long long long long long long comment */ -}; - -// Prettier main -call( - /* a long long long long long long long long long long long long comment */ -); -array = [ - /* a long long long long long long long long long long long long comment */ -]; -object = { - /* a long long long long long long long long long long long long comment */ -}; -``` diff --git a/changelog_unreleased/javascript/18617.md b/changelog_unreleased/javascript/18617.md deleted file mode 100644 index 400979305..000000000 --- a/changelog_unreleased/javascript/18617.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Don't force empty array and object with short comments to break (#18617 by @fisker) - - -```jsx -// Input -const array = [/* comment */] -const object = {/* comment */} - -// Prettier stable -const array = [ - /* comment */ -]; -const object = { - /* comment */ -}; - -// Prettier main -const array = [/* comment */]; -const object = {/* comment */}; -``` diff --git a/changelog_unreleased/javascript/18623.md b/changelog_unreleased/javascript/18623.md deleted file mode 100644 index 8b2d38565..000000000 --- a/changelog_unreleased/javascript/18623.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Fix dangling comment print in function parameters (#18623 by @fisker) - - -```jsx -// Input -fn = function( - // comment -) {} -arrow = ( - // comment -) => {} - -// Prettier stable -fn = function () // comment -{}; -arrow = () => - // comment - {}; - -// Prettier main -fn = function ( - // comment -) {}; -arrow = ( - // comment -) => {}; -``` diff --git a/changelog_unreleased/javascript/18669.md b/changelog_unreleased/javascript/18669.md deleted file mode 100644 index aacc8ab49..000000000 --- a/changelog_unreleased/javascript/18669.md +++ /dev/null @@ -1,29 +0,0 @@ -#### Fix inconsistent comment attach between `NewExpression` and `CallExpression` (#18669 by @fisker) - - -```jsx -// Input -foo( // comment - bar -); -new Foo( // comment - bar -); - -// Prettier stable -foo( - // comment - bar, -); -new Foo(bar); // comment - -// Prettier main -foo( - // comment - bar, -); -new Foo( - // comment - bar, -); -``` diff --git a/changelog_unreleased/javascript/18720.md b/changelog_unreleased/javascript/18720.md deleted file mode 100644 index d94d86b3d..000000000 --- a/changelog_unreleased/javascript/18720.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Fix missing parentheses around optional chaining (#18720 by @fisker) - - -```jsx -// Input -(a?.b()).c(); - -// Prettier stable -a?.b().c(); - -// Prettier main -(a?.b()).c(); -``` diff --git a/changelog_unreleased/javascript/18734.md b/changelog_unreleased/javascript/18734.md deleted file mode 100644 index d7c3bf6a3..000000000 --- a/changelog_unreleased/javascript/18734.md +++ /dev/null @@ -1,14 +0,0 @@ -#### Fix range format on variable declaration (#18734, #18740 by @fisker) - - -```jsx -// Input -let i ="format me!" ; -// ^^^^^^^^^^^^^^ Range - -// Prettier stable -let i = "format me!"; ; - -// Prettier main -let i = "format me!"; -``` diff --git a/changelog_unreleased/javascript/18736-2.md b/changelog_unreleased/javascript/18736-2.md deleted file mode 100644 index ae85e93f2..000000000 --- a/changelog_unreleased/javascript/18736-2.md +++ /dev/null @@ -1,28 +0,0 @@ -#### Improve blank line detection between statements (#18736 by @fisker) - - -```jsx -// Input -const exports = text - .matchAll(/(?<=\n)exports\.(?\w+) = \k;/g) - .map((match) => match.groups.specifier) - .toArray() -; - -foo(); - -// Prettier stable (--no-semi) -const exports = text - .matchAll(/(?<=\n)exports\.(?\w+) = \k;/g) - .map((match) => match.groups.specifier) - .toArray(); -foo(); - -// Prettier main -const exports = text - .matchAll(/(?<=\n)exports\.(?\w+) = \k;/g) - .map((match) => match.groups.specifier) - .toArray(); - -foo(); -``` diff --git a/changelog_unreleased/javascript/18736.md b/changelog_unreleased/javascript/18736.md deleted file mode 100644 index 0ffd619b4..000000000 --- a/changelog_unreleased/javascript/18736.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Preserve empty line before `;` in `no-semi` mode (#18736, #18737 by @fisker) - - -```jsx -// Input -a - -;[].b() - -// Prettier stable (--no-semi) -a -;[].b() - -// Prettier main -a - -;[].b() -``` diff --git a/changelog_unreleased/javascript/18751.md b/changelog_unreleased/javascript/18751.md deleted file mode 100644 index 45a5fb2da..000000000 --- a/changelog_unreleased/javascript/18751.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Print leading semicolon before type cast comments (#18751 by @fisker) - - -```jsx -// Input -;/** @type {string[]} */ (['foo', 'bar']).forEach(doStuff) - -// Prettier stable (--no-semi, first format) -/** @type {string[]} */ ;(["foo", "bar"]).forEach(doStuff) - -// Prettier stable (--no-semi, second format) -/** @type {string[]} */ ;["foo", "bar"].forEach(doStuff) - -// Prettier main (--no-semi) -;/** @type {string[]} */ (["foo", "bar"]).forEach(doStuff) -``` diff --git a/changelog_unreleased/javascript/18775.md b/changelog_unreleased/javascript/18775.md deleted file mode 100644 index 5997b704c..000000000 --- a/changelog_unreleased/javascript/18775.md +++ /dev/null @@ -1,30 +0,0 @@ -#### Prevent moving comments after arrow into parameters (#18775 by @fisker) - - -```jsx -// Input -KEYPAD_NUMBERS.map(num => ( // Buttons 0-9 -
-)); - -const createIdFilter = - (foo) => /** @param {string} id */ - (id) => id; - -// Prettier stable -KEYPAD_NUMBERS.map( - ( - num // Buttons 0-9 - ) =>
-); - -const createIdFilter = (foo /** @param {string} id */) => (id) => id; - -// Prettier main -KEYPAD_NUMBERS.map((num) => ( - // Buttons 0-9 -
-)); - -const createIdFilter = (foo) => /** @param {string} id */ (id) => id; -``` diff --git a/changelog_unreleased/javascript/18813.md b/changelog_unreleased/javascript/18813.md deleted file mode 100644 index d69164c52..000000000 --- a/changelog_unreleased/javascript/18813.md +++ /dev/null @@ -1,30 +0,0 @@ -#### Fix comments above `else` (#18813 by @fisker) - - -```jsx -// Input -/* Case 1 */ -if (1) { -} - -/* Case 2 */ -else if (2) { -} - -// Prettier stable -/* Case 1 */ -if (1) { -} else if (2) { - -/* Case 2 */ -} - -// Prettier main -/* Case 1 */ -if (1) { -} - -/* Case 2 */ -else if (2) { -} -``` diff --git a/changelog_unreleased/javascript/18840.md b/changelog_unreleased/javascript/18840.md deleted file mode 100644 index 8b423d110..000000000 --- a/changelog_unreleased/javascript/18840.md +++ /dev/null @@ -1,14 +0,0 @@ -#### Fix "comment not printed" error in debugger statement (#18840 by @fisker) - - -```jsx -// Input -debugger // Comment -; - -// Prettier stable -Error: Comment "comment" was not printed. Please report this error! - -// Prettier main -debugger; // Comment -``` diff --git a/changelog_unreleased/javascript/18851.md b/changelog_unreleased/javascript/18851.md deleted file mode 100644 index d64c39958..000000000 --- a/changelog_unreleased/javascript/18851.md +++ /dev/null @@ -1,30 +0,0 @@ -#### Improve `do..while` print in `no-semi` mode (#18851 by @fisker) - - -```jsx -// Input -do { - doStuff() -} while (1) - -// comment -;[foo, bar].forEach(doStuff) - -// Prettier stable -do { - doStuff() -} while ( - 1 - - // comment -) -;[foo, bar].forEach(doStuff) - -// Prettier main -do { - doStuff() -} while (1) - -// comment -;[foo, bar].forEach(doStuff) -``` diff --git a/changelog_unreleased/javascript/18963.md b/changelog_unreleased/javascript/18963.md deleted file mode 100644 index e14f548e3..000000000 --- a/changelog_unreleased/javascript/18963.md +++ /dev/null @@ -1,26 +0,0 @@ -#### Fix duplicated comments in empty branches with `experimentalTernaries` (#18963 by @kovsu) - - -```jsx -// Input -condition ? ifTrue -: [ - // Hello, world! - ]; - -// Prettier stable (--experimental-ternaries) -condition ? ifTrue - // Hello, world! -: ( - [ - // Hello, world! - ] -); - -// Prettier main (--experimental-ternaries) -condition ? ifTrue : ( - [ - // Hello, world! - ] -); -``` diff --git a/changelog_unreleased/javascript/19161.md b/changelog_unreleased/javascript/19161.md deleted file mode 100644 index ce2969c38..000000000 --- a/changelog_unreleased/javascript/19161.md +++ /dev/null @@ -1,37 +0,0 @@ -#### Preserve blank lines between JSX attributes (#19161 by @Poliklot) - -Prettier now keeps one existing blank line between JSX attributes, consistent with how it preserves blank lines in many other places. Multiple blank lines are still collapsed to one. - - -```jsx -// Input -