Prettier v3.8.1
Playground link
Input:
<!DOCTYPE html>
<HTML CLASS="no-js mY-ClAsS">
<HEAD>
<META CHARSET="utf-8">
<TITLE>My tITlE</TITLE>
<META NAME="description" content="My CoNtEnT">
</HEAD>
<body>
@switch(state) {
@case('finished') {
<div>Finished</div>
}
@case('open') {
<div>Open</div>
}
@case('errored') {
<div>Error - Example</div>
}
@default never; <!-- https://angular.dev/api/core/@switch#exhaustive-type-checking -->
}
<P>Hello world!<BR> This is HTML5 Boilerplate.</P>
<SCRIPT>
window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date;
ga('create', 'UA-XXXXX-Y', 'auto'); ga('send', 'pageview')
</SCRIPT>
<SCRIPT src="https://www.google-analytics.com/analytics.js" ASYNC DEFER></SCRIPT>
</body>
</HTML>
Output:
SyntaxError: Incomplete block "default never". If you meant to write the @ character, you should use the "@" HTML entity instead. (19:7)
17 | <div>Error - Example</div>
18 | }
> 19 | @default never; <!-- https://angular.dev/api/core/@switch#exhaustive-type-checking -->
| ^^^^^^^^^^^^^^
20 | }
21 | <P>Hello world!<BR> This is HTML5 Boilerplate.</P>
22 | <SCRIPT>
Expected output:
<!DOCTYPE html>
<HTML CLASS="no-js mY-ClAsS">
<HEAD>
<META CHARSET="utf-8" />
<TITLE>My tITlE</TITLE>
<META NAME="description" content="My CoNtEnT" />
</HEAD>
<body>
@switch (state) {
@case ("finished") {
<div>Finished</div>
}
@case ("open") {
<div>Open</div>
}
@case ("errored") {
<div>Error - Example</div>
}
@default never;
<!-- https://angular.dev/api/core/@switch#exhaustive-type-checking -->
}
<P>Hello world!<BR /> This is HTML5 Boilerplate.</P>
<SCRIPT>
window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new
Date; ga('create', 'UA-XXXXX-Y', 'auto'); ga('send', 'pageview')
</SCRIPT>
<SCRIPT
src="https://www.google-analytics.com/analytics.js"
ASYNC
DEFER
></SCRIPT>
</body>
</HTML>
Why?
https://angular.dev/api/core/@switch#exhaustive-type-checking
Prettier v3.8.1
Playground link
Input:
Output:
Expected output:
Why?
https://angular.dev/api/core/@switch#exhaustive-type-checking