惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
J
Java Code Geeks
博客园 - 聂微东
量子位
C
Check Point Blog
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
B
Blog
罗磊的独立博客
腾讯CDC
GbyAI
GbyAI
博客园 - 【当耐特】
A
About on SuperTechFans
M
MIT News - Artificial intelligence
U
Unit 42
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队

Prettier Blog

Prettier 3.9: Major parser upgrades and Formatting improvements Prettier 3.7: Improved formatting consistency and new plugin features! Prettier 3.6: Experimental fast CLI and new OXC and Hermes plugins! Prettier 3.5: New objectWrap option, experimentalOperatorPosition option and TS config file support! Prettier 3.4: A lot of bug fixes Prettier 3.3: New Flow features and a lot of bug fixes Prettier 3.2: Support JSONC and Angular’s ICU expression Prettier's CLI: A Performance Deep Dive $20k Bounty was Claimed! Prettier 3.1: New experimental ternaries formatting and Angular control flow syntax! A curious case of the ternaries Prettier 3.0: Hello, ECMAScript Modules! Prettier 2.8: improve --cache CLI option and TypeScript 4.9 satisfies operator! Prettier 2.7: new --cache CLI option and TypeScript 4.7 syntax! Prettier 2.6: new singleAttributePerLine option and new JavaScript features! Prettier begins paying maintainers Prettier 2.5: TypeScript 4.5 and MDX v2 comment syntax! Prettier 2.4: new bracketSameLine option and TypeScript 4.4 support! Prettier 2.3. In which assignments are consistent, short keys non-breaking, and Handlebars official Prettier for Ruby goes v1.0 🎉
Prettier 3.8: Support for Angular v21.1
Fisker Cheung · 2026-01-14 · via Prettier Blog

· 2 min read

We're excited to announce that Prettier now fully supports the fresh features landing in Angular v21.1 (released today 🎉)!

This update brings cleaner, more expressive templates with:

  • Consecutive @case statements in @switch blocks.
  • Spread elements (...) in array literals, object literals, and function calls inside templates.

We've also added the ability to format Angular syntax beautifully inside Markdown code blocks.

If you find Prettier valuable and want to help us keep pace with fast-moving frameworks like Angular, please consider sponsoring us on OpenCollective or supporting the projects we rely on. Thank you for being part of this community — your support means a lot!

Highlights

Angular

Support for consecutive switch cases (#18593 by @fisker)

<!-- Input -->

@switch (userRole) {

@case ('admin')

@case ('moderator') {

<p>Welcome, boss! Full access.</p>

}

@case ('user') { <p>Standard access</p> }

@default { <p>Guest view</p> }

}

<!-- Prettier 3.7 -->

SyntaxError: Incomplete block "case". If you meant to write the @ character, you should use the "&#64;" HTML entity instead. (2:3)

<!-- Prettier 3.8 -->

@switch (userRole) {

@case ("admin")

@case ("moderator") {

<p>Welcome, boss! Full access.</p>

}

@case ("user") {

<p>Standard access</p>

}

@default {

<p>Guest view</p>

}

}

Support for spread elements (#18596, #18636 by @fisker)

<!-- Input -->

<MyComponent

[array]="[ ...foo, ...bar]"

[object]="{...bar, ...extra }"

[call]="call( ...baz)"

/>

<!-- Prettier 3.7 -->

<MyComponent

[array]="[ ...foo, ...bar]"

[object]="{...bar, ...extra }"

[call]="call( ...baz)"

/>

<!-- Prettier 3.8 -->

<MyComponent

[array]="[...foo, ...bar]"

[object]="{ ...bar, ...extra }"

[call]="call(...baz)"

/>

Other Changes

Angular

Don't print attribute values that are single template or string literals on new lines (#18378 by @ravindUwU)

<!-- Input -->

<component

[property]="`

template

literal

`"

/>

<!-- Prettier 3.7 -->

<component

[property]="

`

template

literal

`

"

/>

<!-- Prettier 3.8 -->

<component

[property]="`

template

literal

`"

/>

Markdown

Support formatting Angular syntax in code block (#18519 by @fisker)

<!-- Input -->

```angular-ts

@Component({

selector: 'app-root',

template: `<div

>Welcome to {{

Angular}}! </div>`,

})

export class App {}

```

```angular-html

<div

>Welcome to {{

Angular}}! </div>

```

<!-- Prettier 3.7 -->

Same as input

<!-- Prettier 3.8 -->

```angular-ts

@Component({

selector: "app-root",

template: `<div>Welcome to {{ Angular }}!</div>`,

})

export class App {}

```

```angular-html

<div>Welcome to {{ Angular }}!</div>

```

  • Highlights
    • Angular
  • Other Changes
    • Angular
    • Markdown