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

推荐订阅源

The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
V
V2EX
博客园 - 司徒正美
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
雷峰网
雷峰网
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题
美团技术团队
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
爱范儿
爱范儿
博客园 - 聂微东
量子位
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Vercel News
Vercel News

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