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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
Engineering at Meta
Engineering at Meta
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
博客园_首页
美团技术团队
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
J
Java Code Geeks
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog
雷峰网
雷峰网
爱范儿
爱范儿

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