Update dependency prettier to v3.4.2 - autoclosed
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
prettier (source) | devDependencies | minor | ^3.2.4 -> 3.4.2 |
Release Notes
prettier/prettier
v3.4.2
#16796 by @tats-u)
Treat U+30A0 & U+30FB in Katakana Block as CJK (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 “サン=サーンス”).
#16891 by @fisker)
Fix comments print on class methods with decorators (// Input
class A {
@​decorator
/**
* The method description
*
*/
async method(foo: Foo, bar: Bar) {
console.log(foo);
}
}
// Prettier 3.4.1
class A {
@​decorator
async /**
* The method description
*
*/
method(foo: Foo, bar: Bar) {
console.log(foo);
}
}
// Prettier 3.4.2
class A {
@​decorator
/**
* The method description
*
*/
async method(foo: Foo, bar: Bar) {
console.log(foo);
}
}
#16899 by @seiyab)
Fix non-idempotent formatting (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
v-on
(#16887 by @fisker)
Remove unnecessary parentheses around assignment in <!-- Input -->
<template>
<button @​click="foo += 2">Click</button>
</template>
<!-- Prettier 3.4.0 -->
<template>
<button @​click="(foo += 2)">Click</button>
</template>
<!-- Prettier 3.4.1 -->
<template>
<button @​click="foo += 2">Click</button>
</template>
v3.4.0
v3.3.3
#16391 by @cdignam-segment)
Add parentheses for nullish coalescing in ternary (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);
#16458 by @y-schneider)
Add parentheses for decorator expressions (Prevent parentheses around member expressions or tagged template literals from being removed to follow the stricter parsing rules of TypeScript 5.5.
// Input
@​(foo`tagged template`)
class X {}
// Prettier 3.3.2
@​foo`tagged template`
class X {}
// Prettier 3.3.3
@​(foo`tagged template`)
class X {}
@let
declaration syntax (#16474 by @sosukesuzuki)
Support 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:
@​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
@
(#16358 by @Princeyadav05)
Fix handlebars path expressions starts with {{! Input }}
<div>{{@​x.y.z}}</div>
{{! Prettier 3.3.1 }}
<div>{{@​x}}</div>
{{! Prettier 3.3.2 }}
<div>{{@​x.y.z}}</div>
v3.3.1
#16347 by @fisker)
Preserve empty lines in front matter (<!-- Input -->
---
foo:
- bar1
- bar2
- bar3
---
Markdown
<!-- Prettier 3.3.0 -->
---
foo:
- bar1
- bar2
- bar3
---
Markdown
<!-- Prettier 3.3.1 -->
---
foo:
- bar1
- bar2
- bar3
---
Markdown
#16348 by @fisker)
Preserve explicit language in front matter (<!-- Input -->
---yaml
title: Hello
slug: home
---
<!-- Prettier 3.3.0 -->
---
title: Hello
slug: home
---
<!-- Prettier 3.3.1 -->
---yaml
title: Hello
slug: home
---
#16349 by @fisker)
Avoid line breaks in import attributes (// 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
v3.2.5
#15968 by @sosukesuzuki)
Support Angular inline styles as single template literal (Angular v17 supports single string inline styles.
// Input
@​Component({
template: `<div>...</div>`,
styles: `h1 { color: blue; }`,
})
export class AppComponent {}
// Prettier 3.2.4
@​Component({
template: `<div>...</div>`,
styles: `h1 { color: blue; }`,
})
export class AppComponent {}
// Prettier 3.2.5
@​Component({
template: `<div>...</div>`,
styles: `
h1 {
color: blue;
}
`,
})
export class AppComponent {}
#15969 by @JounQin)
Unexpected embedded formatting for Angular template (Computed template should not be considered as Angular component template
// Input
const template = "foobar";
@​Component({
[template]: `<h1>{{ hello }}</h1>`,
})
export class AppComponent {}
// Prettier 3.2.4
const template = "foobar";
@​Component({
[template]: `<h1>{{ hello }}</h1>`,
})
export class AppComponent {}
// Prettier 3.2.5
const template = "foobar";
@​Component({
[template]: `<h1>{{ hello }}</h1>`,
})
export class AppComponent {}
"json"
parser for tsconfig.json
by default (#16012 by @sosukesuzuki)
Use 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"
}
}
]
}
Configuration
-
If you want to rebase/retry this MR, click this checkbox.
This MR has been generated by Renovate Bot.