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

推荐订阅源

V
V2EX
Y
Y Combinator Blog
博客园_首页
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
宝玉的分享
宝玉的分享
B
Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
WordPress大学
WordPress大学
L
LangChain Blog
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
博客园 - 聂微东
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Help Net Security

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