diff --git a/changelog_unreleased/angular/17238.md b/changelog_unreleased/angular/17238.md deleted file mode 100644 index d2dae546e..000000000 --- a/changelog_unreleased/angular/17238.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Support `TemplateLiteral` introduced in Angular 19.2 (#17238 by @fisker) - -Angular 29.2 added [support for `TemplateLiteral`](https://blog.angular.dev/angular-19-2-is-now-available-673ec70aea12#ed7b). - - -```html - -
{{ `Hello, ${ -getName('world')}` }}
- - -
- {{ `Hello, ${ -getName('world')}` }} -
- - -
{{ `Hello, ${getName("world")}` }}
-``` diff --git a/changelog_unreleased/angular/17280.md b/changelog_unreleased/angular/17280.md deleted file mode 100644 index 567e92c8d..000000000 --- a/changelog_unreleased/angular/17280.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Remove extra colon after `track` in angular `@for` control-flow (#17280 by @claudio-herger) - - -```angular -// Input -@for (item of items; let i = $index; let count = $count; track block) {} - -// Prettier stable -@for (item of items; let i = $index; let count = $count; track: block) {} - -// Prettier main -@for (item of items; let i = $index; let count = $count; track block) {} -``` diff --git a/changelog_unreleased/angular/17534.md b/changelog_unreleased/angular/17534.md deleted file mode 100644 index f53e323d1..000000000 --- a/changelog_unreleased/angular/17534.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Support Angular 20 (#17534 by @fisker) - - -```angular -// Input -{{ - ( (a in (b))) -}} -{{ - ( (tag ` a ${ b } \u0063 `)) -}} -{{ - ( (` a ${ b } \u0063 `)) -}} -{{ void(1 + 2) }} - -// Prettier stable -The new syntax is not correctly recognized. - -// Prettier main -{{ a in b }} -{{ tag` a ${b} \u0063 ` }} -{{ ` a ${b} \u0063 ` }} -{{ void (1 + 2) }} -``` diff --git a/changelog_unreleased/api/17166.md b/changelog_unreleased/api/17166.md deleted file mode 100644 index 44d42f9b9..000000000 --- a/changelog_unreleased/api/17166.md +++ /dev/null @@ -1,47 +0,0 @@ -#### Accept `URL` in `plugins` option (#17166 by @fisker) - -`plugins` option now accepts [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) with `file:` protocol or a url string that starts with `file:` in all public APIs. - -```js -// `URL` -await prettier.check("foo", { - parser: "my-cool-parser", - plugins: [new URL("./path/to/plugin.js", import.meta.url)], -}); -await prettier.format("foo", { - parser: "my-cool-parser", - plugins: [new URL("./path/to/plugin.js", import.meta.url)], -}); -await prettier.formatWithCursor("foo", { - parser: "my-cool-parser", - cursorOffset: 2, - plugins: [new URL("./path/to/plugin.js", import.meta.url)], -}); -await prettier.getFileInfo("/path/to/file", { - plugins: [new URL("./path/to/plugin.js", import.meta.url)], -}); -await prettier.getSupportInfo({ - plugins: [new URL("./path/to/plugin.js", import.meta.url)], -}); - -// URL string -await prettier.check("foo", { - parser: "my-cool-parser", - plugins: ["file:///path/to/plugin.js"], -}); -await prettier.format("foo", { - parser: "my-cool-parser", - plugins: ["file:///path/to/plugin.js"], -}); -await prettier.formatWithCursor("foo", { - parser: "my-cool-parser", - cursorOffset: 2, - plugins: ["file:///path/to/plugin.js"], -}); -await prettier.getFileInfo("/path/to/file", { - plugins: ["file:///path/to/plugin.js"], -}); -await prettier.getSupportInfo({ - plugins: ["file:///path/to/plugin.js"], -}); -``` diff --git a/changelog_unreleased/api/17167.md b/changelog_unreleased/api/17167.md deleted file mode 100644 index 15e30d755..000000000 --- a/changelog_unreleased/api/17167.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Accept `URL` as custom config file in `resolveConfig` (#17167 by @fisker) - -[`prettier.resolveConfig()`](https://prettier.io/docs/api#prettierresolveconfigfileurlorpath--options) now accepts an [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) with `file:` protocol or a url string that starts with `file:` as custom config file location. - -```js -// `URL` -await prettier.resolveConfig("path/to/file", { - config: new URL("/path/to/prettier-config-file", import.meta.url), -}); - -// URL string -await prettier.resolveConfig("path/to/file", { - config: "file:///path/to/prettier-config-file", -}); -``` diff --git a/changelog_unreleased/api/17178.md b/changelog_unreleased/api/17178.md deleted file mode 100644 index 3c2d82eec..000000000 --- a/changelog_unreleased/api/17178.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Stop interpret `*.frag` files as JavaScript files (#17178 by @fisker) - -`*.frag` was interpreted as JavaScript files, but `.frag` is also used in GLSL([OpenGL Shading Language](https://en.wikipedia.org/wiki/OpenGL_Shading_Language)). It causes error when Prettier try to format them as JavaScript files. - -Since Prettier main, `*.frag` files except `*.start.frag`, `*.end.frag`, `start.frag`, and `end.frag` are no longer treated as JavaScript files. - -If you have JavaScript files with `.frag` that do not match the patterns mentioned above, you can config with `overrides`. - -```js -export default { - overrides: { - files: "**/*.frag", - options: { - parser: "babel", - }, - }, -}; -``` diff --git a/changelog_unreleased/api/17331.md b/changelog_unreleased/api/17331.md deleted file mode 100644 index 3c4eede57..000000000 --- a/changelog_unreleased/api/17331.md +++ /dev/null @@ -1,24 +0,0 @@ -#### Add `isSupported` function support for `languages` API (#17331 by @JounQin, #17490 by @fisker) - -Previously, `languages` API for custom plugins only supported inferring parser based on the file basename or extension. - -Prettier main added `isSupported: (options: { filepath: string }) => boolean` function to allow plugin check if file is supported based on the full path (eg: files in a specific directory). - -:::note - -Prettier can not ensure that `filepath` exists on disk.\ -When using from APIs(eg: `prettier.format()`), Prettier can not ensure it's a valid path either. - -::: - -If no `isSupported` provided, it just behaves the same way as before. - -```js -export const languages = [ - { - name: "foo", - parsers: ["foo"], - isSupported: ({ filepath }) => filepath.includes(".foo"), - }, -]; -``` diff --git a/changelog_unreleased/api/17339.md b/changelog_unreleased/api/17339.md deleted file mode 100644 index 529ee232f..000000000 --- a/changelog_unreleased/api/17339.md +++ /dev/null @@ -1,3 +0,0 @@ -#### Add `mjml` parser (#17339 by @fisker) - -We already support [MJML](https://mjml.io/) in previous version with `html` parser, in order to distinguish MJML-specific a new `mjml` parser added. diff --git a/changelog_unreleased/api/17344.md b/changelog_unreleased/api/17344.md deleted file mode 100644 index fb4762bdc..000000000 --- a/changelog_unreleased/api/17344.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Ignore files with `--check-ignore-pragma` (#17344 by @wnayes) - -Individual files can now opt out of formatting via `@noformat` or `@noprettier` "pragma" comments at the top of the file. - -To enable this feature, use the new option [`--check-ignore-pragma`](https://prettier.io/docs/options#check-ignore-pragma) (`checkIgnorePragma` via configuration or API). - -Language plugins can [implement support](https://prettier.io/docs/plugins#parsers) for this feature. Most built-in parsers, including JavaScript (TypeScript), CSS, HTML, JSON, Markdown (MDX), YAML, and GraphQL, were updated to support this feature. - - -```jsx -/** - * @noformat - */ - -export default matrix( - 1, 0, 0, - 0, 1, 0, - 0, 0, 1 -); -``` diff --git a/changelog_unreleased/api/17548.md b/changelog_unreleased/api/17548.md deleted file mode 100644 index 860245fe2..000000000 --- a/changelog_unreleased/api/17548.md +++ /dev/null @@ -1,29 +0,0 @@ -#### Fix plugin loading in `prettier.getFileInfo()` (#17548 by @fisker) - -In previous version, `prettier.getFileInfo()` only read `parser` config from `.prettierrc`, but doesn't load plugins to infer parser from plugin `languages`, Prettier main fixed it. - -```js -// prettier-plugin-foo -export const languages = [ - { - parsers: ["foo"], - extensions: [".foo"], - }, -]; -``` - -```yaml -# .prettierrc -plugins: - - prettier-plugin-foo -``` - -```console -prettier --file-info file.foo - -# Prettier stable -{ "ignored": false, "inferredParser": null } - -# Prettier main -{ "ignored": false, "inferredParser": "foo" } -``` diff --git a/changelog_unreleased/api/17549.md b/changelog_unreleased/api/17549.md deleted file mode 100644 index 265c342f5..000000000 --- a/changelog_unreleased/api/17549.md +++ /dev/null @@ -1,32 +0,0 @@ -#### Allow plugin to override builtin parsers when inferring parser (#17549 by @fisker) - -Previously when inferring parser for file, builtin plugins are checked first, so plugins are not able to override parsers for files like `.js`. - -```js -// prettier-plugin-foo -export const languages = [ - { - parsers: ["foo"], - extensions: [".js"], - }, -]; -``` - -```js -// prettier.config.js -import * as prettierPluginFoo from "prettier-plugin-foo"; - -export default { - plugins: [prettierPluginFoo], -}; -``` - -```console -prettier --file-info file.js - -# Prettier stable -{ "ignored": false, "inferredParser": "babel" } - -# Prettier main -{ "ignored": false, "inferredParser": "foo" } -``` diff --git a/changelog_unreleased/blog-post-intro.md b/changelog_unreleased/blog-post-intro.md deleted file mode 100644 index a9a39ed08..000000000 --- a/changelog_unreleased/blog-post-intro.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -authors: "sosukesuzuki" -title: "Prettier 3.6: Experimental fast CLI and new OXC and Hermes plugins!" ---- - -This release includes several important feature additions that we're excited to share with you. - -First, we're shipping a new experimental high-performance CLI behind a feature flag (`--experimental-cli`). This CLI was previously only available in `prettier@next`, but now you can enable it simply by using a flag. We encourage you to try it out and share your feedback! If you are interested in the internal implementation, please read [Prettier's CLI: Performance Deep Dive by Fabio](https://prettier.io/blog/2023/11/30/cli-deep-dive). - -Additionally, we're releasing two new official plugins: [`@prettier/plugin-oxc`](https://github.com/prettier/prettier/tree/main/packages/plugin-oxc) and [`@prettier/plugin-hermes`](https://github.com/prettier/prettier/tree/main/packages/plugin-hermes). These plugins are provided separately from Prettier's core. - -We want to extend our heartfelt gratitude to everyone who made this amazing release possible: [@fabiospampinato](https://github.com/fabiospampinato), [@43081j](https://github.com/43081j), and [@pralkarz](https://github.com/pralkarz) along with the new CLI contributors, [@boshen](https://github.com/boshen) and [@overlookmotel](https://github.com/overlookmotel) along with other OXC contributors, the [Flow](https://flow.org/) and [Hermes](https://github.com/facebook/hermes/blob/main/README.md) teams at Meta. Thank you all for your incredible contributions! - -We're excited to see how these new features enhance your development experience. Happy formatting! diff --git a/changelog_unreleased/cli/12221.md b/changelog_unreleased/cli/12221.md deleted file mode 100644 index c7c54e47e..000000000 --- a/changelog_unreleased/cli/12221.md +++ /dev/null @@ -1,6 +0,0 @@ -#### Forbid use `--config` and `--no-config` together (#12221 by @Balastrong) - -```console -$ prettier --config=.prettierrc --no-config . -[error] Cannot use --no-config and --config together. -``` diff --git a/changelog_unreleased/cli/17151.md b/changelog_unreleased/cli/17151.md deleted file mode 100644 index 2340bc74e..000000000 --- a/changelog_unreleased/cli/17151.md +++ /dev/null @@ -1,11 +0,0 @@ -#### [HIGHLIGHT] Support experimental CLI (#17151, #17396 by @fisker) - -You may have already heard of or used our new [performance improved CLI](https://prettier.io/blog/2023/11/30/cli-deep-dive). From prettier main, you can now use it without installing unstable v4 version. - -```sh -# Run CLI with `--experimental-cli` -prettier . --check --experimental-cli - -# Or use environment variable `PRETTIER_EXPERIMENTAL_CLI=1` -PRETTIER_EXPERIMENTAL_CLI=1 prettier . --check -``` diff --git a/changelog_unreleased/cli/17438.md b/changelog_unreleased/cli/17438.md deleted file mode 100644 index c87901366..000000000 --- a/changelog_unreleased/cli/17438.md +++ /dev/null @@ -1,3 +0,0 @@ -#### Ignore file modified time when `--cache-strategy=content` (#17438 by @fisker) - -In previous version, when using `--cache-strategy=content`, if the file modified time changed, it still gets re-formatted even the file content didn't change, Prettier main fixed it. diff --git a/changelog_unreleased/cli/17505-2.md b/changelog_unreleased/cli/17505-2.md deleted file mode 100644 index 6c0df4b52..000000000 --- a/changelog_unreleased/cli/17505-2.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Fix result message for files can not be formatted (#17505 by @fisker) - -```console -touch unknown -prettier --check unknown - -# Prettier stable -Checking formatting... -unknown -[error] No parser could be inferred for file "". -All matched files use Prettier code style! - -# Prettier main -Checking formatting... -unknown -[error] No parser could be inferred for file "". -Error occurred when checking code style in the above file. -``` diff --git a/changelog_unreleased/cli/17505.md b/changelog_unreleased/cli/17505.md deleted file mode 100644 index 80f9bda85..000000000 --- a/changelog_unreleased/cli/17505.md +++ /dev/null @@ -1,14 +0,0 @@ -#### Fix exitCode when parser cannot infer (#17505 by @fisker) - -```console -touch unknown -prettier --check unknown > /dev/null;echo $? - -# Prettier stable -[error] No parser could be inferred for file "". -0 - -# Prettier main -[error] No parser could be inferred for file "". -2 -``` diff --git a/changelog_unreleased/css/17362.md b/changelog_unreleased/css/17362.md deleted file mode 100644 index 6ea918f2f..000000000 --- a/changelog_unreleased/css/17362.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Support `@utility` directive for Tailwind (#17362 by @sosukesuzuki) - -This change supports `@utility` directive for Tailwind CSS V4. - - -```css -/* Input */ -@utility tab-* { - tab-size: --value(--tab-size-*); -} - -/* Prettier stable */ -@utility tab-* { - tab-size: --value(--tab-size- *); -} - -/* Prettier main */ -@utility tab-* { - tab-size: --value(--tab-size-*); -} -``` diff --git a/changelog_unreleased/css/17541.md b/changelog_unreleased/css/17541.md deleted file mode 100644 index 57d9b6f87..000000000 --- a/changelog_unreleased/css/17541.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Remove extra indentation for `:has` pseudo call (#17541 by @sosukesuzuki) - - -```css -/* Input */ -li:has( - path[d="M544,272H480V150.627L523.314,107.314A16,16,0,0,0,500.686,84.687L457.373,128H415a127.00381,127.00381,0,1,0-254,0H118.627L75.314,84.687A16,16,0,1,0,52.686,107.314L96,150.627V272H32a16,16,0,0,0,0,32H96v24a174.98856,174.98856,0,0,0,30.484,98.889L68.687,484.686a15.99972,15.99972,0,1,0,22.627,22.627l55.616-55.616A175.45165,175.45165,0,0,0,272,504h32a175.45165,175.45165,0,0,0,125.07-52.303l55.616,55.616a15.99972,15.99972,0,0,0,22.627-22.627l-57.797-57.797A174.98856,174.98856,0,0,0,480,328V304h64a16,16,0,0,0,0-32ZM288,32.01263A95.99568,95.99568,0,0,1,383,128H193A95.99568,95.99568,0,0,1,288,32.01263ZM448,328c0,79.401-64.598,144-144,144V236a12.00052,12.00052,0,0,0-12-12h-8a12.00052,12.00052,0,0,0-12,12V472c-79.402,0-144-64.599-144-144V160H448Z"] -) { - display: none; -} - -/* Prettier stable */ -li:has( - path[d="M544,272H480V150.627L523.314,107.314A16,16,0,0,0,500.686,84.687L457.373,128H415a127.00381,127.00381,0,1,0-254,0H118.627L75.314,84.687A16,16,0,1,0,52.686,107.314L96,150.627V272H32a16,16,0,0,0,0,32H96v24a174.98856,174.98856,0,0,0,30.484,98.889L68.687,484.686a15.99972,15.99972,0,1,0,22.627,22.627l55.616-55.616A175.45165,175.45165,0,0,0,272,504h32a175.45165,175.45165,0,0,0,125.07-52.303l55.616,55.616a15.99972,15.99972,0,0,0,22.627-22.627l-57.797-57.797A174.98856,174.98856,0,0,0,480,328V304h64a16,16,0,0,0,0-32ZM288,32.01263A95.99568,95.99568,0,0,1,383,128H193A95.99568,95.99568,0,0,1,288,32.01263ZM448,328c0,79.401-64.598,144-144,144V236a12.00052,12.00052,0,0,0-12-12h-8a12.00052,12.00052,0,0,0-12,12V472c-79.402,0-144-64.599-144-144V160H448Z"] - ) { - display: none; -} - -/* Prettier main */ -li:has( - path[d="M544,272H480V150.627L523.314,107.314A16,16,0,0,0,500.686,84.687L457.373,128H415a127.00381,127.00381,0,1,0-254,0H118.627L75.314,84.687A16,16,0,1,0,52.686,107.314L96,150.627V272H32a16,16,0,0,0,0,32H96v24a174.98856,174.98856,0,0,0,30.484,98.889L68.687,484.686a15.99972,15.99972,0,1,0,22.627,22.627l55.616-55.616A175.45165,175.45165,0,0,0,272,504h32a175.45165,175.45165,0,0,0,125.07-52.303l55.616,55.616a15.99972,15.99972,0,0,0,22.627-22.627l-57.797-57.797A174.98856,174.98856,0,0,0,480,328V304h64a16,16,0,0,0,0-32ZM288,32.01263A95.99568,95.99568,0,0,1,383,128H193A95.99568,95.99568,0,0,1,288,32.01263ZM448,328c0,79.401-64.598,144-144,144V236a12.00052,12.00052,0,0,0-12-12h-8a12.00052,12.00052,0,0,0-12,12V472c-79.402,0-144-64.599-144-144V160H448Z"] -) { - display: none; -} -``` diff --git a/changelog_unreleased/flow/17196.md b/changelog_unreleased/flow/17196.md deleted file mode 100644 index ec6ea8f61..000000000 --- a/changelog_unreleased/flow/17196.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Fix missing parentheses in `ConditionalTypeAnnotation` (#17196 by @fisker) - - -```jsx -// Input -type T = 'a' | ('b' extends U ? 'c' : empty); -type T = 'a' & ('b' extends U ? 'c' : empty); - -// Prettier stable -type T = "a" | "b" extends U ? "c" : empty; -type T = "a" & "b" extends U ? "c" : empty; - -// Prettier main -type T = "a" | ("b" extends U ? "c" : empty); -type T = "a" & ("b" extends U ? "c" : empty); -``` diff --git a/changelog_unreleased/flow/17520.md b/changelog_unreleased/flow/17520.md deleted file mode 100644 index f014dff42..000000000 --- a/changelog_unreleased/flow/17520.md +++ /dev/null @@ -1,26 +0,0 @@ -#### [HIGHLIGHT] Added a new official plugin `@prettier/plugin-hermes` (#17520 by @fisker) - -`@prettier/plugin-hermes` is based on [Hermes JS Engine](https://github.com/facebook/hermes/blob/main/README.md). - -This plugin includes a new parser `hermes` (Flow syntax), to use this plugin: - -1. Install the plugin - - ```sh - yarn add --dev prettier @prettier/plugin-hermes - ``` - -2. Add the following to your `.prettierrc` file - - ```yaml - plugins: - - "@prettier/plugin-hermes" - ``` - -Due to package size limitations, this plugin is not included in the `prettier` package, it needs to be installed separately. - -**We plan to make this as the default parser for Flow syntax support in v4, we'll also remove `babel-flow` parser in v4, please give it a try.** - -For more information, check [the package homepage](https://github.com/prettier/prettier/tree/main/packages/plugin-hermes). - -Many thanks to the Hermes team. diff --git a/changelog_unreleased/html/17501.md b/changelog_unreleased/html/17501.md deleted file mode 100644 index e792c4e09..000000000 --- a/changelog_unreleased/html/17501.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Fix formatting when tag name is an object prototype property (#17501 by @fisker) - - -```html - - - text - - - -TypeError: Vn(...).startsWith is not a function - - - text -``` diff --git a/changelog_unreleased/javascript/17085.md b/changelog_unreleased/javascript/17085.md deleted file mode 100644 index dfe1c6774..000000000 --- a/changelog_unreleased/javascript/17085.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Add parentheses to `SequenceExpression` in `ReturnStatement` and `ExpressionStatement` (#17085 by @TYKevin) - - -```jsx -// Input -function a() { - return ( a, b) -} - -(a(), b()); - -// Prettier stable -function a() { - return a, b; -} - -a(), b(); - -// Prettier main -function a() { - return (a, b); -} - -(a(), b()); -``` diff --git a/changelog_unreleased/javascript/17145.md b/changelog_unreleased/javascript/17145.md deleted file mode 100644 index 720b6f773..000000000 --- a/changelog_unreleased/javascript/17145.md +++ /dev/null @@ -1,36 +0,0 @@ -#### Add parentheses to `AssignmentExpression` in class property keys (#17145 by @fisker) - -Previously we only add parentheses to `AssignmentExpression` in object keys, but not in class property keys. Thanks to [Biome](https://biomejs.dev/formatter/differences-with-prettier/#prettier-has-an-inconsistent-behavior-for-assignment-in-computed-keys) for bringing our attention to this inconsistency. - - -```jsx -// Input -a = { - [(x = "key")]: 1, -} - -class A { - [(x = "property")] = 1; - [(x = "method")]() {} -} - -// Prettier stable -a = { - [(x = "key")]: 1, -}; - -class A { - [x = "property"] = 1; - [(x = "method")]() {} -} - -// Prettier main -a = { - [(x = "key")]: 1, -}; - -class A { - [(x = "property")] = 1; - [(x = "method")]() {} -} -``` diff --git a/changelog_unreleased/javascript/17190.md b/changelog_unreleased/javascript/17190.md deleted file mode 100644 index 6d98d8875..000000000 --- a/changelog_unreleased/javascript/17190.md +++ /dev/null @@ -1,26 +0,0 @@ -#### Add parentheses to numbers in optional member expression (#17190 by @fisker) - -There is an inconsistency when formatting member expression where the object is a number before Prettier main. - -When using `babel` parser(and other Babel based parsers), we print the number as unparenthesized, when using `typescript` parser(and other ESTree parsers), we print it as parenthesized. - -Technically parentheses are not needed, but if we print it as `1?.toString()` and later users realize it's unnecessary to use `?.`, users can't simply remove the question mark because `1.toString()` will raise a `SyntaxError`, for this reason, we decide to always put parentheses around it. - - -```jsx -// Input -(1)?.toString(); -(1.5)?.toString(); - -// Prettier stable (--parser=babel) -1?.toString(); -1.5?.toString(); - -// Prettier stable (--parser=typescript) -(1)?.toString(); -(1.5)?.toString(); - -// Prettier main -(1)?.toString(); -(1.5)?.toString(); -``` diff --git a/changelog_unreleased/javascript/17363.md b/changelog_unreleased/javascript/17363.md deleted file mode 100644 index fceb5e310..000000000 --- a/changelog_unreleased/javascript/17363.md +++ /dev/null @@ -1,5 +0,0 @@ -#### Removed support for experimental `Records & Tuples` (#17363 by @fisker) - -The ES proposal [JavaScript Records & Tuples Proposal](https://github.com/tc39/proposal-record-tuple) has been withdrawn. - -- [Disclaimer about non-standard syntax](https://prettier.io/docs/en/rationale.html#disclaimer-about-non-standard-syntax) diff --git a/changelog_unreleased/javascript/17398.md b/changelog_unreleased/javascript/17398.md deleted file mode 100644 index a45a7831f..000000000 --- a/changelog_unreleased/javascript/17398.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Preserve spaces between CSS words and embedded expression (#17398 by @sosukesuzuki) - - -```jsx -// Input -const Heading = styled.h1` - font-size: var(--font-size-h${level}); -`; - -// Prettier stable -const Heading = styled.h1` - font-size: var(--font-size-h ${level}); -`; - -// Prettier main -const Heading = styled.h1` - font-size: var(--font-size-h${level}); -`; -``` diff --git a/changelog_unreleased/javascript/17469.md b/changelog_unreleased/javascript/17469.md deleted file mode 100644 index 57929f600..000000000 --- a/changelog_unreleased/javascript/17469.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Fix inconsistent assignment format (#17469 by @fisker) - - -```jsx -// Input -didScheduleRenderPhaseUpdateDuringThisPassFoo = didScheduleRenderPhaseUpdate = true - -// Prettier stable (--parser=babel) -didScheduleRenderPhaseUpdateDuringThisPassFoo = - didScheduleRenderPhaseUpdate = true; - -// Prettier stable (--parser=typescript) -didScheduleRenderPhaseUpdateDuringThisPassFoo = didScheduleRenderPhaseUpdate = - true; - -// Prettier main -didScheduleRenderPhaseUpdateDuringThisPassFoo = - didScheduleRenderPhaseUpdate = true; -``` diff --git a/changelog_unreleased/javascript/17470.md b/changelog_unreleased/javascript/17470.md deleted file mode 100644 index 9d3907fd9..000000000 --- a/changelog_unreleased/javascript/17470.md +++ /dev/null @@ -1,22 +0,0 @@ -#### Fix inconsistent member chain format (#17470 by @fisker) - - -```jsx -// Input -s.get(u)?.trigger({ triggerKind: y.SignatureHelpTriggerKind.InvokeFooBarBaz123 }); - -// Prettier stable (--parser=babel) -s.get(u)?.trigger({ - triggerKind: y.SignatureHelpTriggerKind.InvokeFooBarBaz123, -}); - -// Prettier stable (--parser=typescript) -s - .get(u) - ?.trigger({ triggerKind: y.SignatureHelpTriggerKind.InvokeFooBarBaz123 }); - -// Prettier main -s.get(u)?.trigger({ - triggerKind: y.SignatureHelpTriggerKind.InvokeFooBarBaz123, -}); -``` diff --git a/changelog_unreleased/javascript/17472.md b/changelog_unreleased/javascript/17472.md deleted file mode 100644 index 94a228b7c..000000000 --- a/changelog_unreleased/javascript/17472.md +++ /dev/null @@ -1,24 +0,0 @@ -#### [HIGHLIGHT] Added a new official plugin `@prettier/plugin-oxc` (#17472, #17483 by @fisker) - -`@prettier/plugin-oxc` is based on [OXC](https://oxc.rs/)(A **fast** JavaScript and TypeScript parser in Rust). - -This plugin includes two new parsers `oxc` (JavaScript syntax) and `oxc-ts` (TypeScript syntax), to use this plugin: - -1. Install the plugin - - ```sh - yarn add --dev prettier @prettier/plugin-oxc - ``` - -2. Add the following to your `.prettierrc` file - - ```yaml - plugins: - - "@prettier/plugin-oxc" - ``` - -Due to package size limitations, this plugin is not included in the `prettier` package, it needs to be installed separately. - -For more information, check [the package homepage](https://github.com/prettier/prettier/tree/main/packages/plugin-oxc). - -Many thanks to the OXC team([@boshen](https://github.com/boshen), [@overlookmotel](https://github.com/overlookmotel), and other contributors). diff --git a/changelog_unreleased/javascript/17486.md b/changelog_unreleased/javascript/17486.md deleted file mode 100644 index 152d33a8e..000000000 --- a/changelog_unreleased/javascript/17486.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Fix optional chaining as computed key (#17486 by @fisker) - - -```jsx -// Input -const a = { [y?.z]() {} }; -class A { [y?.z]() {} }; - -// Prettier stable -const a = { [y?.z]?() {} }; -class A { - [y?.z]?() {} -} - -// Prettier main -const a = { [y?.z]() {} }; -class A { - [y?.z]() {} -} -``` diff --git a/changelog_unreleased/javascript/17491.md b/changelog_unreleased/javascript/17491.md deleted file mode 100644 index 5e9e7048c..000000000 --- a/changelog_unreleased/javascript/17491.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Support type cast comments for `acorn` and `meriyah` parser (#17491, #17566 by @ArnaudBarre, #17600 by #fisker) - -This was previously only supported by the Babel parser. - - -```js -// Input -/** @type {MyType} */ (x).foo; - -// Prettier stable (--parser=acorn|meriyah) -/** @type {MyType} */ x.foo; - -// Prettier main -/** @type {MyType} */ (x).foo; -``` diff --git a/changelog_unreleased/javascript/17510.md b/changelog_unreleased/javascript/17510.md deleted file mode 100644 index fa083e2d9..000000000 --- a/changelog_unreleased/javascript/17510.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Fix unstable comment format in tagged template literal (#17510 by @fisker) - - -```js -// Input -foo - // Comment - `x` - -// Prettier stable (First format) -foo// Comment -`x`; - -// Prettier stable (Second format) -foo // Comment -`x`; - -// Prettier main -foo // Comment -`x`; -``` diff --git a/changelog_unreleased/javascript/17616.md b/changelog_unreleased/javascript/17616.md deleted file mode 100644 index 775a9d050..000000000 --- a/changelog_unreleased/javascript/17616.md +++ /dev/null @@ -1,46 +0,0 @@ -#### Improve consistency for JSX in optional method call (#17616 by @seiyab) - - -```jsx -// Input - -
- {Array(20) - .fill() - ?.map((_, i) => ( -

{i + 1}

- ))} -
-
; - -// Prettier stable (ESTree based parsers like espree and typescript) - -
- {Array(20) - .fill() - ?.map((_, i) =>

{i + 1}

)} -
-
; - -// Prettier stable (babel and babel-ts parser) - -
- {Array(20) - .fill() - ?.map((_, i) => ( -

{i + 1}

- ))} -
-
; - -// Prettier main (parsers of both types) - -
- {Array(20) - .fill() - ?.map((_, i) => ( -

{i + 1}

- ))} -
-
; -``` diff --git a/changelog_unreleased/json/17269.md b/changelog_unreleased/json/17269.md deleted file mode 100644 index 844860667..000000000 --- a/changelog_unreleased/json/17269.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Allow format comment-only JSONC files (#17269 by @fisker) - - -```jsonc -// Input -// Comment - -// Prettier stable -SyntaxError: Unexpected token (1:11) -> 1 | // Comment - | ^ - -// Prettier main -// Comment -``` diff --git a/changelog_unreleased/json/17598.md b/changelog_unreleased/json/17598.md deleted file mode 100644 index ca93af92b..000000000 --- a/changelog_unreleased/json/17598.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Forbid parenthesized expressions (#17598 by @fisker) - - -```json -// Input -[1, (2)] - -// Prettier stable -[1, 2] - -// Prettier main -SyntaxError: 'ParenthesizedExpression' is not allowed in JSON. (1:5) -> 1 | [1, (2)] - | ^^^ -``` diff --git a/changelog_unreleased/less/17502.md b/changelog_unreleased/less/17502.md deleted file mode 100644 index cf1a3494a..000000000 --- a/changelog_unreleased/less/17502.md +++ /dev/null @@ -1,22 +0,0 @@ -#### Fix function argument incorrectly lowercased (#17502 by @fisker) - - -```less -// Input -.what { - .make-modifier(1A, "1a.png"); - .make-modifier(AA, "1a.png"); -} - -// Prettier stable -.what { - .make-modifier(1a, "1a.png"); - .make-modifier(AA, "1a.png"); -} - -// Prettier main -.what { - .make-modifier(1A, "1a.png"); - .make-modifier(AA, "1a.png"); -} -``` diff --git a/changelog_unreleased/markdown/16596.md b/changelog_unreleased/markdown/16596.md deleted file mode 100644 index 35a7cc4ed..000000000 --- a/changelog_unreleased/markdown/16596.md +++ /dev/null @@ -1,35 +0,0 @@ -#### Fix adjacent markdown syntax in blockquote (#16596 by @fiji-flo) - - -```md - -> `x` -> `y` - -> _x_ -> _y_ - -> [foo](http://foo) -> [bar](http://bar) - -> `this` behaves -> `correctly` - - -> `x` > `y` - -> _x_ > _y_ - -> [foo](http://foo) > [bar](http://bar) - -> `this` behaves `correctly` - - -> `x` `y` - -> _x_ _y_ - -> [foo](http://foo) [bar](http://bar) - -> `this` behaves `correctly` -``` diff --git a/changelog_unreleased/markdown/16637.md b/changelog_unreleased/markdown/16637.md deleted file mode 100644 index 1fb8fd259..000000000 --- a/changelog_unreleased/markdown/16637.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Fix markdown inserts unexpected newline in lists (#16637 by @byplayer) - - -```md - -- Level 1 - - Level 1-1 - -- Level 2 - - -- Level 1 - - - Level 1-1 - -- Level 2 - - - -- Level 1 - - Level 1-1 - -- Level 2 - -``` diff --git a/changelog_unreleased/markdown/17143.md b/changelog_unreleased/markdown/17143.md deleted file mode 100644 index b6e3471a0..000000000 --- a/changelog_unreleased/markdown/17143.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Fix strong emphasis (#17143 by @fiji-flo) - -Most markdown implementations don't support `1**_2_**3` so prefer `1***2**3`. - - -```md - -1***2***3 -1**_2_**3 - - -1**_2_**3 -1**_2_**3 - - -1***2***3 -1***2***3 -``` diff --git a/changelog_unreleased/misc/17254.md b/changelog_unreleased/misc/17254.md deleted file mode 100644 index 334277a8d..000000000 --- a/changelog_unreleased/misc/17254.md +++ /dev/null @@ -1,51 +0,0 @@ -#### Fix embedded format with `cursorOffset` (#17254 by @fisker) - - -````md - -# Angular note - -```typescript - import {Component} from '@angular/core'; - - @Component({ - selector: 'app-root', - standalone: true, - imports: [], - template: ` -

- - {{ title }}

- `, - styleUrls: ['./app.component.css'], - }) - export class AppComponent { - title = 'default'; - } -``` - - -Error: There are too many 'cursor' in doc. - - -# Angular note - -```typescript -import { Component } from "@angular/core"; - -@Component({ - selector: "app-root", - standalone: true, - imports: [], - template: ` -

- {{ title }} -

- `, - styleUrls: ["./app.component.css"], -}) -export class AppComponent { - title = "default"; -} -``` -```` diff --git a/changelog_unreleased/mjml/17338.md b/changelog_unreleased/mjml/17338.md deleted file mode 100644 index 7abf7192d..000000000 --- a/changelog_unreleased/mjml/17338.md +++ /dev/null @@ -1,31 +0,0 @@ -#### Enabling CSS formatting within `` tag (#17338 by @iryusa) - - -```mjml - - -.hello { - color: blue; - border: 1px solid blue; -font-size:12px; -} p { font-size: 14px; } - - - - - .hello { color: blue; border: 1px solid blue; font-size:12px; } p { font-size: - 14px; } - - - - - .hello { - color: blue; - border: 1px solid blue; - font-size: 12px; - } - p { - font-size: 14px; - } - -``` diff --git a/changelog_unreleased/mjml/17400.md b/changelog_unreleased/mjml/17400.md deleted file mode 100644 index 59f025afb..000000000 --- a/changelog_unreleased/mjml/17400.md +++ /dev/null @@ -1,17 +0,0 @@ -#### Correctly parse `` and `` (#17400 by @fisker) - - -```html - - - a::before { - content: "

"; - } -
- - -SyntaxError: Unexpected closing tag "p". - - -Correctly parsed as CSS. -``` diff --git a/changelog_unreleased/typescript/16881.md b/changelog_unreleased/typescript/16881.md deleted file mode 100644 index 9b2345167..000000000 --- a/changelog_unreleased/typescript/16881.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Support import type attribute in `TSImportType` (#16881 by @fisker) - - -```jsx -// Input -type A = import("foo", {with: {type: "json"}}) - -// Prettier stable -type A = import("foo") - -// Prettier main -type A = import("foo", { with: { type: "json" } }); -``` diff --git a/changelog_unreleased/typescript/17193.md b/changelog_unreleased/typescript/17193.md deleted file mode 100644 index 5e7b18108..000000000 --- a/changelog_unreleased/typescript/17193.md +++ /dev/null @@ -1,32 +0,0 @@ -#### Fix comments in logical expression and intersection type (#17193 by @fisker) - - -```jsx -// Input -export type ErrorLike = - SerializedProps & - // cause is a new addition to Error that is not yet available in all runtimes. We have added - // it to try and pinpoint additional reasoning for failures such as Node's fetch. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause - { cause?: unknown }; - -// Prettier stable -export type ErrorLike = - SerializedProps & // cause is a new addition to Error that is not yet available in all runtimes. We have added - // it to try and pinpoint additional reasoning for failures such as Node's fetch. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause - { cause?: unknown }; - -// Prettier stable (second format) -export type ErrorLike = - SerializedProps & // it to try and pinpoint additional reasoning for failures such as Node's fetch. // cause is a new addition to Error that is not yet available in all runtimes. We have added - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause - { cause?: unknown }; - -// Prettier main -export type ErrorLike = SerializedProps & - // cause is a new addition to Error that is not yet available in all runtimes. We have added - // it to try and pinpoint additional reasoning for failures such as Node's fetch. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause - { cause?: unknown }; -``` diff --git a/changelog_unreleased/typescript/17498.md b/changelog_unreleased/typescript/17498.md deleted file mode 100644 index 77db2f5dd..000000000 --- a/changelog_unreleased/typescript/17498.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Improve new line detect in mapped type (#17498 by @fisker) - - -```jsx -// Input -type A = { readonly - [A in B]: T} - -// Prettier stable -type A = { - readonly [A in B]: T; -}; - -// Prettier main -type A = { readonly [A in B]: T }; -``` diff --git a/changelog_unreleased/typescript/17538.md b/changelog_unreleased/typescript/17538.md deleted file mode 100644 index f0dd805dd..000000000 --- a/changelog_unreleased/typescript/17538.md +++ /dev/null @@ -1,22 +0,0 @@ -#### Don't print extra semicolon after `prettier-ignore`d index-signature (#17538 by @sosukesuzuki) - - -```tsx -// Input -type foo = { - // prettier-ignore - [key: string]: bar; -}; - -// Prettier stable -type foo = { - // prettier-ignore - [key: string]: bar;; -}; - -// Prettier main -type foo = { - // prettier-ignore - [key: string]: bar; -}; -``` diff --git a/changelog_unreleased/yaml/16074.md b/changelog_unreleased/yaml/16074.md deleted file mode 100644 index b091fc1ac..000000000 --- a/changelog_unreleased/yaml/16074.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Do not add line break before empty map or sequence (#16074 by @BapRx) - - -```yaml -# Input ---- -myDict: {} - # comment -myList: [] - # comment - -# Prettier stable ---- -myDict: - {} - # comment -myList: - [] - # comment - -# Prettier main ---- -myDict: {} - # comment -myList: [] - # comment -```