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

推荐订阅源

博客园 - Franky
N
Netflix TechBlog - Medium
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
The Cloudflare Blog
Blog — PlanetScale
Blog — PlanetScale
F
Full Disclosure
G
Google Developers Blog
罗磊的独立博客
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
A
About on SuperTechFans
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
GbyAI
GbyAI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
The Register - Security
The Register - Security
U
Unit 42
D
Docker
Martin Fowler
Martin Fowler
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
阮一峰的网络日志
阮一峰的网络日志
C
Cybersecurity and Infrastructure Security Agency CISA
博客园_首页
Google DeepMind News
Google DeepMind News

Prettier Blog

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