From c52f4418461c76708e81886d69affbc7bfccd2d0 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Sat, 13 Jan 2024 01:22:01 +0900 Subject: [PATCH] Clean changelog_unreleased --- changelog_unreleased/angular/15777.md | 19 --------- changelog_unreleased/angular/15827.md | 30 -------------- changelog_unreleased/angular/15887.md | 13 ------ changelog_unreleased/api/15666.md | 15 ------- changelog_unreleased/api/15854.md | 11 ----- changelog_unreleased/graphql/15870.md | 29 -------------- changelog_unreleased/handlebars/15605.md | 21 ---------- changelog_unreleased/html/15748.md | 18 --------- changelog_unreleased/javascript/15209.md | 21 ---------- changelog_unreleased/javascript/15522.md | 22 ---------- changelog_unreleased/javascript/15677.md | 19 --------- changelog_unreleased/javascript/15806.md | 51 ------------------------ changelog_unreleased/javascript/15826.md | 27 ------------- changelog_unreleased/json/15831.md | 9 ----- changelog_unreleased/misc/15750.md | 3 -- changelog_unreleased/typescript/15811.md | 24 ----------- 16 files changed, 332 deletions(-) delete mode 100644 changelog_unreleased/angular/15777.md delete mode 100644 changelog_unreleased/angular/15827.md delete mode 100644 changelog_unreleased/angular/15887.md delete mode 100644 changelog_unreleased/api/15666.md delete mode 100644 changelog_unreleased/api/15854.md delete mode 100644 changelog_unreleased/graphql/15870.md delete mode 100644 changelog_unreleased/handlebars/15605.md delete mode 100644 changelog_unreleased/html/15748.md delete mode 100644 changelog_unreleased/javascript/15209.md delete mode 100644 changelog_unreleased/javascript/15522.md delete mode 100644 changelog_unreleased/javascript/15677.md delete mode 100644 changelog_unreleased/javascript/15806.md delete mode 100644 changelog_unreleased/javascript/15826.md delete mode 100644 changelog_unreleased/json/15831.md delete mode 100644 changelog_unreleased/misc/15750.md delete mode 100644 changelog_unreleased/typescript/15811.md diff --git a/changelog_unreleased/angular/15777.md b/changelog_unreleased/angular/15777.md deleted file mode 100644 index 5e71f974f..000000000 --- a/changelog_unreleased/angular/15777.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Support formatting for Angular ICU expression (#15777 by @sosukesuzuki) - -Support two kinds of Angular ICU expressions: [`plural`](https://angular.dev/guide/i18n/translation-files#translate-plurals) and [`select`](https://angular.dev/guide/i18n/translation-files#translate-alternate-expressions). - - -```html - - Updated: - {minutes, plural, - =0 {just now} - =1 {one minute ago} - other {{{minutes}} minutes ago} - } - - - - The author is {gender, select, male {male} female {female} other {other}} - -``` diff --git a/changelog_unreleased/angular/15827.md b/changelog_unreleased/angular/15827.md deleted file mode 100644 index 1cee11c2c..000000000 --- a/changelog_unreleased/angular/15827.md +++ /dev/null @@ -1,30 +0,0 @@ -#### Fix `prettier-ignore`d angular control flow block (#15827 by @fisker) - - -```html - - -@if (condition) { - Foo -} @else { - Other -} - - - -@if (condition) { - Foo -} -} @else { - Other -} - - - -@if (condition) { - Foo -} -@else { - Other -} -``` diff --git a/changelog_unreleased/angular/15887.md b/changelog_unreleased/angular/15887.md deleted file mode 100644 index e1e40cde7..000000000 --- a/changelog_unreleased/angular/15887.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Avoid adding colon for `track` in 3rd expression of `for` blocks (#15887 by @sosukesuzuki) - - -```html - -@for (item of items; let i = $index; track block) {} - - -@for (item of items; let i = $index; track: block) {} - - -@for (item of items; let i = $index; track block) {} -``` diff --git a/changelog_unreleased/api/15666.md b/changelog_unreleased/api/15666.md deleted file mode 100644 index 2ad2b069b..000000000 --- a/changelog_unreleased/api/15666.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Support absolute path as plugin in config file (#15666 by @fisker) - -```js -// prettier.config.cjs -module.exports = { - plugins: [ - // posix style - "/path/to/plugin.js", - // Windows style - "D:\\\\path\\to\\plugin.js", - // Use `require.resolve` - require.resolve("my-awesome-prettier-plugin"), - ], -}; -``` diff --git a/changelog_unreleased/api/15854.md b/changelog_unreleased/api/15854.md deleted file mode 100644 index 593066da4..000000000 --- a/changelog_unreleased/api/15854.md +++ /dev/null @@ -1,11 +0,0 @@ -#### Fix `getFileInfo` and `getSupportInfo` type definitions (#15854 by @auvred) - -```ts -const plugin: Plugin = {}; - -prettier.getFileInfo("./file.ext", { - plugins: [plugin], -}); - -prettier.getSupportInfo({ plugins: [plugin], showDeprecated: true }); -``` diff --git a/changelog_unreleased/graphql/15870.md b/changelog_unreleased/graphql/15870.md deleted file mode 100644 index ef2deb5d3..000000000 --- a/changelog_unreleased/graphql/15870.md +++ /dev/null @@ -1,29 +0,0 @@ -#### Improve GraphQL union types formatting (#15870 by @ArchitGajjar) - - -```gql -# Input -union SearchResult = Conference| Festival | Concert | Venue | Conference| Festival | Concert | Venue - -# Prettier stable -union SearchResult = - Conference - | Festival - | Concert - | Venue - | Conference - | Festival - | Concert - | Venue - -# Prettier main -union SearchResult = - | Conference - | Festival - | Concert - | Venue - | Conference - | Festival - | Concert - | Venue -``` diff --git a/changelog_unreleased/handlebars/15605.md b/changelog_unreleased/handlebars/15605.md deleted file mode 100644 index 628f5d53b..000000000 --- a/changelog_unreleased/handlebars/15605.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Preserve path literal segments (#15605 by @maxpowa) - -Fixes scenarios where an input handlebars file containing literal segments would be reformatted to unwrap the literal segments, causing syntax errors in the resulting output. - - -```hbs - -{{input.[funky -{{input.funky -{{input.[funky -```html - - -

-Hello world! - - - -

- - - -

-Hello world! -``` diff --git a/changelog_unreleased/javascript/15209.md b/changelog_unreleased/javascript/15209.md deleted file mode 100644 index c533b1dfa..000000000 --- a/changelog_unreleased/javascript/15209.md +++ /dev/null @@ -1,21 +0,0 @@ -#### Avoid introducing linebreaks in template interpolations (#15209 by @bakkot) - -In a template string like - - -```js -`this is a long message which contains an interpolation: ${format(data)} <- like this`; -``` - -avoid adding a linebreak when formatting the expression unless one is already present or it's unavoidable due to e.g. a nested function. Previously a linebreak could be introduced whenever some interpolation in the template was sufficiently "not simple": - - -```js -`this is a long message which contains an interpolation: ${format( - data, -)} <- like this`; -``` - -Now it will instead be left alone. - -If a linebreak is already present within the `${...}`, format as normal. diff --git a/changelog_unreleased/javascript/15522.md b/changelog_unreleased/javascript/15522.md deleted file mode 100644 index cd4623c84..000000000 --- a/changelog_unreleased/javascript/15522.md +++ /dev/null @@ -1,22 +0,0 @@ -#### Fix non-idempotent formatting of method chain with empty line (#15522 by @seiyab) - - -```js -// Input -Foo.a() - -.b(); - -// Prettier stable (first format) -Foo.a() -.b(); - -// Prettier stable (second format) -Foo.a().b(); - - -// Prettier main -Foo.a() - - .b(); -``` diff --git a/changelog_unreleased/javascript/15677.md b/changelog_unreleased/javascript/15677.md deleted file mode 100644 index 23b340497..000000000 --- a/changelog_unreleased/javascript/15677.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Fix formatting of ternary in function call (#15677 by @fisker) - - -```jsx -// Input -stopDirectory = await (useCache - ? memoizedFindProjectRoot - : findProjectRootWithoutCache)(path.dirname(path.resolve(filePath))); - -// Prettier stable -stopDirectory = await (useCache - ? memoizedFindProjectRoot - : findProjectRootWithoutCache)(path.dirname(path.resolve(filePath))); - -// Prettier main -stopDirectory = await ( - useCache ? memoizedFindProjectRoot : findProjectRootWithoutCache -)(path.dirname(path.resolve(filePath))); -``` diff --git a/changelog_unreleased/javascript/15806.md b/changelog_unreleased/javascript/15806.md deleted file mode 100644 index 8c14c4ebb..000000000 --- a/changelog_unreleased/javascript/15806.md +++ /dev/null @@ -1,51 +0,0 @@ -#### Fix inconsistencies for optional-chaining (#15806 by @fisker) - -Only happens when using `typescript`, `meriyah` or other ESTree parsers except `babel`. - - -```js -// Input -function someFunctionName() { - return isEqual(a.map(([t, _]) => t?.id), b.map(([t, _]) => t?.id)); - return isEqual(a?.map(([t, _]) => t?.id), b?.map(([t, _]) => t?.id)); -} -theValue = Object.entries(someLongObjectName).filter( - ([listingId]) => someListToCompareToHere.includes(listingId), -); -theValue = Object.entries(someLongObjectName).filter( - ([listingId]) => someListToCompareToHere?.includes(listingId), -); - -// Prettier stable -function someFunctionName() { - return isEqual( - a.map(([t, _]) => t?.id), - b.map(([t, _]) => t?.id), - ); - return isEqual(a?.map(([t, _]) => t?.id), b?.map(([t, _]) => t?.id)); -} -theValue = Object.entries(someLongObjectName).filter(([listingId]) => - someListToCompareToHere.includes(listingId), -); -theValue = Object.entries(someLongObjectName).filter( - ([listingId]) => someListToCompareToHere?.includes(listingId), -); - -// Prettier main -function someFunctionName() { - return isEqual( - a.map(([t, _]) => t?.id), - b.map(([t, _]) => t?.id), - ); - return isEqual( - a?.map(([t, _]) => t?.id), - b?.map(([t, _]) => t?.id), - ); -} -theValue = Object.entries(someLongObjectName).filter(([listingId]) => - someListToCompareToHere.includes(listingId), -); -theValue = Object.entries(someLongObjectName).filter(([listingId]) => - someListToCompareToHere?.includes(listingId), -); -``` diff --git a/changelog_unreleased/javascript/15826.md b/changelog_unreleased/javascript/15826.md deleted file mode 100644 index 87f79f32e..000000000 --- a/changelog_unreleased/javascript/15826.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Fix comments in `if` (#15826 by @fisker) - - -```js -// Input -if (foo) for (i = 2; i > 0; i--) console.log(i); // comment 1 -else bar(); - -for (;;){ - if (foo) continue; // comment 2 - else bar(); -} - -// Prettier stable -Error: Comment "comment 2" was not printed. Please report this error! - -// Prettier main -if (foo) - for (i = 2; i > 0; i--) console.log(i); // comment 1 -else bar(); - -for (;;) { - if (foo) - continue; // comment 2 - else bar(); -} -``` diff --git a/changelog_unreleased/json/15831.md b/changelog_unreleased/json/15831.md deleted file mode 100644 index a52ecdbab..000000000 --- a/changelog_unreleased/json/15831.md +++ /dev/null @@ -1,9 +0,0 @@ -#### [Highlight] New `jsonc` parser added (#15831 by @fisker) - -Previously, we infer the parser of `.jsonc` files to be `json`, but if we want keep the trailing comma, we'll have to use a hacky workaround config `{parser: "json5", quoteProps: "preserve", singleQuote: false}`. - -The new added `jsonc` parser: - -- Always quote the object keys. -- Wrap strings with double quotes. -- Of course, respect the [`trailingComma`](https://prettier.io/docs/en/options#trailing-commas) option. diff --git a/changelog_unreleased/misc/15750.md b/changelog_unreleased/misc/15750.md deleted file mode 100644 index ebbf8223c..000000000 --- a/changelog_unreleased/misc/15750.md +++ /dev/null @@ -1,3 +0,0 @@ -#### Fix false claim in docs that cursorOffset is incompatible with rangeStart/rangeEnd (#15750 by @ExplodingCabbage) - -The cursorOffset option has in fact been compatible with rangeStart/rangeEnd for over 5 years, thanks to work by @ds300. However, Prettier's documentation (including the CLI `--help` text) continued to claim otherwise, falsely. The documentation is now fixed. diff --git a/changelog_unreleased/typescript/15811.md b/changelog_unreleased/typescript/15811.md deleted file mode 100644 index 6019f07b0..000000000 --- a/changelog_unreleased/typescript/15811.md +++ /dev/null @@ -1,24 +0,0 @@ -#### Improve conditional type alias layout (#15811 by @seiyab) - - -```ts -// Input -type FallbackFlags = - Equals["flags"], {}> extends true - ? Dict - : NonNullableFlag["flags"]; - -// Prettier stable -type FallbackFlags = Equals< - NonNullableFlag["flags"], - {} -> extends true - ? Dict - : NonNullableFlag["flags"]; - -// Prettier main -type FallbackFlags = - Equals["flags"], {}> extends true - ? Dict - : NonNullableFlag["flags"]; -```