Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Jan 20, 2024

This PR contains the following updates:

Package Change Age Confidence
prettier (source) 3.1.1 -> 3.7.2 age confidence

Review

  • Updates have been tested and work
  • If updates are AWS related, versions match the infrastructure (e.g. Lambda runtime, database, etc.)

Release Notes

prettier/prettier (prettier)

v3.7.2

Compare Source

diff

JavaScript: Fix string print when switching quotes (#​18351 by @​fisker)
// Input
console.log("A descriptor\\'s .kind must be \"method\" or \"field\".")

// Prettier 3.7.1
console.log('A descriptor\\'s .kind must be "method" or "field".');

// Prettier 3.7.2
console.log('A descriptor\\\'s .kind must be "method" or "field".');
JavaScript: Preserve quote for embedded HTML attribute values (#​18352 by @​kovsu)
// Input
const html = /* HTML */ ` <div class="${styles.banner}"></div> `;

// Prettier 3.7.1
const html = /* HTML */ ` <div class=${styles.banner}></div> `;

// Prettier 3.7.2
const html = /* HTML */ ` <div class="${styles.banner}"></div> `;
TypeScript: Fix comment in empty type literal (#​18364 by @​fisker)
// Input
export type XXX = {
  // tbd
};

// Prettier 3.7.1
export type XXX = { // tbd };

// Prettier 3.7.2
export type XXX = {
  // tbd
};

v3.7.1

Compare Source

diff

API: Fix performance regression in doc printer (#​18342 by @​fisker)

Prettier 3.7.1 can be very slow when formatting big files, the regression has been fixed.

v3.7.0

Compare Source

diff

🔗 Release Notes

v3.6.2

Compare Source

diff

Markdown: Add missing blank line around code block (#​17675 by @​fisker)
<!-- Input -->
1. Some text, and code block below, with newline after code block

   ```yaml
   ---
   foo: bar
   ```

   1. Another
   2. List

<!-- Prettier 3.6.1 -->
1. Some text, and code block below, with newline after code block

   ```yaml
   ---
   foo: bar
   ```
   1. Another
   2. List

<!-- Prettier 3.6.2 -->
1. Some text, and code block below, with newline after code block

   ```yaml
   ---
   foo: bar
   ```

   1. Another
   2. List

v3.6.1

Compare Source

diff

TypeScript: Allow const without initializer (#​17650, #​17654 by @​fisker)
// Input
export const version: string;

// Prettier 3.6.0 (--parser=babel-ts)
SyntaxError: Unexpected token (1:21)
> 1 | export const version: string;
    |                     ^

// Prettier 3.6.0 (--parser=oxc-ts)
SyntaxError: Missing initializer in const declaration (1:14)
> 1 | export const version: string;
    |              ^^^^^^^^^^^^^^^

// Prettier 3.6.1
export const version: string;
Miscellaneous: Avoid closing files multiple times (#​17665 by @​43081j)

When reading a file to infer the interpreter from a shebang, we use the
n-readlines library to read the first line in order to get the shebang.

This library closes files when it reaches EOF, and we later try close the same
files again. We now close files only if n-readlines did not already close
them.

v3.6.0

Compare Source

diff

🔗 Release Notes

v3.5.3

Compare Source

diff

Flow: Fix missing parentheses in ConditionalTypeAnnotation (#​17196 by @​fisker)
// Input
type T<U> = 'a' | ('b' extends U ? 'c' : empty);
type T<U> = 'a' & ('b' extends U ? 'c' : empty);

// Prettier 3.5.2
type T<U> = "a" | "b" extends U ? "c" : empty;
type T<U> = "a" & "b" extends U ? "c" : empty;

// Prettier 3.5.3
type T<U> = "a" | ("b" extends U ? "c" : empty);
type T<U> = "a" & ("b" extends U ? "c" : empty);

v3.5.2

Compare Source

diff

Remove module-sync condition (#​17156 by @​fisker)

In Prettier 3.5.0, we added module-sync condition to package.json, so that require("prettier") can use ESM version, but turns out it doesn't work if CommonJS and ESM plugins both imports builtin plugins. To solve this problem, we decide simply remove the module-sync condition, so require("prettier") will still use the CommonJS version, we'll revisit until require(ESM) feature is more stable.

v3.5.1

Compare Source

diff

Fix CLI crash when cache for old version exists (#​17100 by @​sosukesuzuki)

Prettier 3.5 uses a different cache format than previous versions, Prettier 3.5.0 crashes when reading existing cache file, Prettier 3.5.1 fixed the problem.

Support dockercompose and github-actions-workflow in VSCode (#​17101 by @​remcohaszing)

Prettier now supports the dockercompose and github-actions-workflow languages in Visual Studio Code.

v3.5.0

Compare Source

diff

🔗 Release Notes

v3.4.2

Compare Source

diff

Treat U+30A0 & U+30FB in Katakana Block as CJK (#​16796 by @​tats-u)

Prettier doesn't treat U+30A0 & U+30FB as Japanese. U+30FB is commonly used in Japanese to represent the delimitation of first and last names of non-Japanese people or “and”. The following “C言語・C++・Go・Rust” means “C language & C++ & Go & Rust” in Japanese.

<!-- Input (--prose-wrap=never) -->

C言
語
・
C++
・
Go
・
Rust

<!-- Prettier 3.4.1 -->
C言語・ C++ ・ Go ・ Rust

<!-- Prettier 3.4.2 -->
C言語・C++・Go・Rust

U+30A0 can be used as the replacement of the - in non-Japanese names (e.g. “Saint-Saëns” (Charles Camille Saint-Saëns) can be represented as “サン゠サーンス” in Japanese), but substituted by ASCII hyphen (U+002D) or U+FF1D (full width hyphen) in many cases (e.g. “サン=サーンス” or “サン=サーンス”).

Fix comments print on class methods with decorators (#​16891 by @​fisker)
// Input
class A {
  @&#8203;decorator
  /** 
   * The method description
   *
  */
  async method(foo: Foo, bar: Bar) {
    console.log(foo);
  }
}

// Prettier 3.4.1
class A {
  @&#8203;decorator
  async /**
   * The method description
   *
   */
  method(foo: Foo, bar: Bar) {
    console.log(foo);
  }
}

// Prettier 3.4.2
class A {
  @&#8203;decorator
  /**
   * The method description
   *
   */
  async method(foo: Foo, bar: Bar) {
    console.log(foo);
  }
}
Fix non-idempotent formatting (#​16899 by @​seiyab)

This bug fix is not language-specific. You may see similar change in any languages. This fixes regression in 3.4.0 so change caused by it should yield same formatting as 3.3.3.

// Input
<div>
  foo
  <span>longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo</span>
  , abc
</div>;

// Prettier 3.4.1 (first)
<div>
  foo
  <span>
    longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo
  </span>, abc
</div>;

// Prettier 3.4.1 (second)
<div>
  foo
  <span>longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo</span>
  , abc
</div>;

// Prettier 3.4.2
<div>
  foo
  <span>longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo</span>
  , abc
</div>;

v3.4.1

Compare Source

diff

Remove unnecessary parentheses around assignment in v-on (#​16887 by @​fisker)
<!-- Input -->
<template>
  <button @&#8203;click="foo += 2">Click</button>
</template>

<!-- Prettier 3.4.0 -->
<template>
  <button @&#8203;click="(foo += 2)">Click</button>
</template>

<!-- Prettier 3.4.1 -->
<template>
  <button @&#8203;click="foo += 2">Click</button>
</template>

v3.4.0

Compare Source

diff

🔗 Release Notes

v3.3.3

Compare Source

diff

Add parentheses for nullish coalescing in ternary (#​16391 by @​cdignam-segment)

This change adds clarity to operator precedence.

// Input
foo ? bar ?? foo : baz;
foo ?? bar ? a : b;
a ? b : foo ?? bar;

// Prettier 3.3.2
foo ? bar ?? foo : baz;
foo ?? bar ? a : b;
a ? b : foo ?? bar;

// Prettier 3.3.3
foo ? (bar ?? foo) : baz;
(foo ?? bar) ? a : b;
a ? b : (foo ?? bar);
Add parentheses for decorator expressions (#​16458 by @​y-schneider)

Prevent parentheses around member expressions or tagged template literals from being removed to follow the stricter parsing rules of TypeScript 5.5.

// Input
@&#8203;(foo`tagged template`)
class X {}

// Prettier 3.3.2
@&#8203;foo`tagged template`
class X {}

// Prettier 3.3.3
@&#8203;(foo`tagged template`)
class X {}
Support @let declaration syntax (#​16474 by @​sosukesuzuki)

Adds support for Angular v18 @let declaration syntax.

Please see the following code example. The @let declaration allows you to define local variables within the template:

@&#8203;let name = 'Frodo';

<h1>Dashboard for {{name}}</h1>
Hello, {{name}}

For more details, please refer to the excellent blog post by the Angular Team: Introducing @​let in Angular.

We also appreciate the Angular Team for kindly answering our questions to implement this feature.

v3.3.2

Compare Source

diff

Fix handlebars path expressions starts with @ (#​16358 by @​Princeyadav05)
{{! Input }}
<div>{{@&#8203;x.y.z}}</div>

{{! Prettier 3.3.1 }}
<div>{{@&#8203;x}}</div>

{{! Prettier 3.3.2 }}
<div>{{@&#8203;x.y.z}}</div>

v3.3.1

Compare Source

diff

Preserve empty lines in front matter (#​16347 by @​fisker)
<!-- Input -->
---
foo:
  - bar1

  - bar2

  - bar3
---
Markdown

<!-- Prettier 3.3.0 -->

---
foo:
  - bar1
  - bar2
  - bar3
---

Markdown

<!-- Prettier 3.3.1 -->
---
foo:
  - bar1

  - bar2

  - bar3
---

Markdown
Preserve explicit language in front matter (#​16348 by @​fisker)
<!-- Input -->
---yaml
title: Hello
slug: home
---

<!-- Prettier 3.3.0 -->
---
title: Hello
slug: home
---

<!-- Prettier 3.3.1 -->
---yaml
title: Hello
slug: home
---
Avoid line breaks in import attributes (#​16349 by @​fisker)
// Input
import something from "./some-very-very-very-very-very-very-very-very-long-path.json" with { type: "json" };

// Prettier 3.3.0
import something from "./some-very-very-very-very-very-very-very-very-long-path.json" with { type:
  "json" };

// Prettier 3.3.1
import something from "./some-very-very-very-very-very-very-very-very-long-path.json" with { type: "json" };

v3.3.0

Compare Source

diff

🔗 Release Notes

v3.2.5

Compare Source

diff

Support Angular inline styles as single template literal (#​15968 by @​sosukesuzuki)

Angular v17 supports single string inline styles.

// Input
@&#8203;Component({
  template: `<div>...</div>`,
  styles: `h1 { color: blue; }`,
})
export class AppComponent {}

// Prettier 3.2.4
@&#8203;Component({
  template: `<div>...</div>`,
  styles: `h1 { color: blue; }`,
})
export class AppComponent {}

// Prettier 3.2.5
@&#8203;Component({
  template: `<div>...</div>`,
  styles: `
    h1 {
      color: blue;
    }
  `,
})
export class AppComponent {}
Unexpected embedded formatting for Angular template (#​15969 by @​JounQin)

Computed template should not be considered as Angular component template

// Input
const template = "foobar";

@&#8203;Component({
  [template]: `<h1>{{       hello }}</h1>`,
})
export class AppComponent {}

// Prettier 3.2.4
const template = "foobar";

@&#8203;Component({
  [template]: `<h1>{{ hello }}</h1>`,
})
export class AppComponent {}

// Prettier 3.2.5
const template = "foobar";

@&#8203;Component({
  [template]: `<h1>{{       hello }}</h1>`,
})
export class AppComponent {}
Use "json" parser for tsconfig.json by default (#​16012 by @​sosukesuzuki)

In v3.2.0, we introduced "jsonc" parser which adds trailing comma by default.

When adding a new parser we also define how it will be used based on the linguist-languages data.

tsconfig.json is a special file used by TypeScript, it uses .json file extension, but it actually uses the JSON with Comments syntax. However, we found that there are many third-party tools not recognize it correctly because of the confusing .json file extension.

We decide to treat it as a JSON file for now to avoid the extra configuration step.

To keep using the "jsonc" parser for your tsconfig.json files, add the following to your .prettierrc file

{
  "overrides": [
    {
      "files": ["tsconfig.json", "jsconfig.json"],
      "options": {
        "parser": "jsonc"
      }
    }
  ]
}

v3.2.4

Compare Source

prettier --file-info tsconfig.json
{ "ignored": false, "inferredParser": "jsonc" }

v3.2.3

Compare Source

diff

Throw errors for invalid code (#​15881 by @​fisker, @​Josh-Cena, @​auvred)
// Input
1++;

// Prettier 3.2.2
1++;

// Prettier 3.2.3
SyntaxError: Invalid left-hand side expression in unary operation (1:1)
> 1 | 1++;
    | ^
// Input
try {} catch (error = 1){}

// Prettier 3.2.2
try {
} catch (error) {}

// Prettier 3.2.3
SyntaxError: Catch clause variable cannot have an initializer. (1:23)
> 1 | try {} catch (error = 1){}
    |                       ^
Fix parser inference (#​15927 by @​fisker)
// Prettier 3.2.2
prettier --file-info tsconfig.json
{ "ignored": false, "inferredParser": "json" }

// Prettier 3.2.3
prettier --file-info tsconfig.json
{ "ignored": false, "inferredParser": "jsonc" }

v3.2.2

Compare Source

diff

Fix crash when parsing template literal CSS in a JSX style tag using a spread attribute (#​15896 by @​eelco)

For example this code would crash before:

<style {...spread}>{`.{}`}</style>
Fix formatting error on optional call expression and member chain (#​15920 by @​sosukesuzuki)
// Input
a(() => {}, c?.d());

// Prettier 3.2.1
TypeError: Cannot read properties of undefined (reading 'type')

// Prettier 3.2.2
a(() => {}, c?.d());

v3.2.1

Compare Source

diff

Fix formatting error on member chain (#​15915 by @​sosukesuzuki)
// Input
test().test2().test2(thing?.something);

// Prettier 3.2.0
TypeError: Cannot read properties of undefined (reading 'type')

// Prettier 3.2.1
test().test2().test2(thing?.something);

v3.2.0

Compare Source

diff

🔗 Release Notes


Configuration

📅 Schedule: Branch creation - "every weekend" in timezone America/Montreal, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/prettier-packages branch from ea2ad1b to f4d869b Compare January 21, 2024 03:23
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.2.1 chore(deps): update dependency prettier to v3.2.2 Jan 21, 2024
@renovate renovate bot force-pushed the renovate/prettier-packages branch from f4d869b to 2a5a6f2 Compare January 24, 2024 03:56
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.2.2 chore(deps): update dependency prettier to v3.2.3 Jan 24, 2024
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 2a5a6f2 to 9da4b7f Compare January 24, 2024 12:21
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.2.3 chore(deps): update dependency prettier to v3.2.4 Jan 24, 2024
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 9da4b7f to 1bfbebe Compare February 11, 2024 07:16
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.2.4 chore(deps): update dependency prettier to v3.2.5 Feb 11, 2024
@renovate renovate bot force-pushed the renovate/prettier-packages branch 3 times, most recently from 1f74b46 to c84ac63 Compare March 8, 2024 16:29
@renovate renovate bot force-pushed the renovate/prettier-packages branch from c84ac63 to b104d9a Compare April 25, 2024 13:29
@renovate renovate bot force-pushed the renovate/prettier-packages branch 2 times, most recently from f2dbd80 to 475fa8b Compare June 8, 2024 19:01
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.2.5 chore(deps): update dependency prettier to v3.3.0 Jun 8, 2024
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 475fa8b to f6e20d0 Compare June 12, 2024 09:58
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.3.0 chore(deps): update dependency prettier to v3.3.1 Jun 12, 2024
@renovate renovate bot force-pushed the renovate/prettier-packages branch from f6e20d0 to 5c78ad7 Compare June 18, 2024 10:09
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.3.1 chore(deps): update dependency prettier to v3.3.2 Jun 18, 2024
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 5c78ad7 to d094b77 Compare July 20, 2024 13:46
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.3.2 chore(deps): update dependency prettier to v3.3.3 Jul 20, 2024
@renovate renovate bot force-pushed the renovate/prettier-packages branch from d094b77 to d1b3589 Compare September 17, 2024 14:13
@renovate renovate bot force-pushed the renovate/prettier-packages branch from d1b3589 to 36aed69 Compare December 3, 2024 07:04
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.3.3 chore(deps): update dependency prettier to v3.4.0 Dec 3, 2024
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 36aed69 to 828cb00 Compare December 3, 2024 13:40
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.4.0 chore(deps): update dependency prettier to v3.4.1 Dec 3, 2024
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 828cb00 to b3754e4 Compare December 11, 2024 07:17
@renovate renovate bot force-pushed the renovate/prettier-packages branch from b3754e4 to 717ae91 Compare February 16, 2025 14:07
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.4.2 chore(deps): update dependency prettier to v3.5.0 Feb 16, 2025
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 717ae91 to 8166d4c Compare February 20, 2025 14:09
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.5.0 chore(deps): update dependency prettier to v3.5.1 Feb 20, 2025
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 8166d4c to e7382b5 Compare March 1, 2025 14:09
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.5.1 chore(deps): update dependency prettier to v3.5.2 Mar 1, 2025
@renovate renovate bot force-pushed the renovate/prettier-packages branch from e7382b5 to a7067e0 Compare March 10, 2025 04:42
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.5.2 chore(deps): update dependency prettier to v3.5.3 Mar 10, 2025
@renovate renovate bot force-pushed the renovate/prettier-packages branch from a7067e0 to 17cba0a Compare June 30, 2025 03:28
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.5.3 chore(deps): update dependency prettier to v3.6.0 Jun 30, 2025
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 17cba0a to d1b11e9 Compare July 2, 2025 14:15
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.6.0 chore(deps): update dependency prettier to v3.6.1 Jul 2, 2025
@renovate renovate bot force-pushed the renovate/prettier-packages branch from d1b11e9 to 445a656 Compare July 4, 2025 04:05
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.6.1 chore(deps): update dependency prettier to v3.6.2 Jul 4, 2025
@renovate renovate bot force-pushed the renovate/prettier-packages branch 5 times, most recently from 9cf949f to 64a3e34 Compare September 11, 2025 19:46
@renovate renovate bot force-pushed the renovate/prettier-packages branch 3 times, most recently from 8200985 to 5bc6418 Compare October 7, 2025 17:58
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 5bc6418 to eba9a7f Compare November 18, 2025 15:52
@renovate renovate bot force-pushed the renovate/prettier-packages branch from eba9a7f to 617be18 Compare December 4, 2025 11:06
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.6.2 chore(deps): update dependency prettier to v3.7.0 Dec 4, 2025
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 617be18 to 541e905 Compare December 4, 2025 14:20
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.7.0 chore(deps): update dependency prettier to v3.7.1 Dec 4, 2025
@renovate renovate bot force-pushed the renovate/prettier-packages branch from 541e905 to 8c3098b Compare December 5, 2025 22:10
@renovate renovate bot changed the title chore(deps): update dependency prettier to v3.7.1 chore(deps): update dependency prettier to v3.7.2 Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants