Prettier is still breaking HTML in 2019
See original GitHub issueVSCode, macOS
"printWidth": 80
<h1 [ngStyle]="{
'color': h1Style ? 'gray' : 'black',
'font-size': !h1Style ? '1em' : '4em'
}">Home</h1>
save result = broken html
<h1
[ngStyle]="{
color: h1Style ? 'gray' : 'black',
'font-size': !h1Style ? '1em' : '4em'
}"
>
Home
</h1>
if edit line length < 80
<h1 [ngStyle]="{color: h1Style ? 'gray' : 'black',
'font-size': !h1Style ? '1em' : '4em'}">Home</h1>
save result = still broken html
<h1
[ngStyle]="{
color: h1Style ? 'gray' : 'black',
'font-size': !h1Style ? '1em' : '4em'
}"
>
Home
</h1>
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Prettier not formatting HTML files in VS Code
Note - TS files and SCSS files are being formatted properly. It is breaking only for HTML files. Below is my HTML language...
Read more >Prettier 1.16: HTML improvements and better CRLF handling
This release improves HTML formatting and contains better CRLF handling, new syntax features, and fixes several bugs.
Read more >How to Setup Vue.js with VS Code and Fix Formatting and ES ...
When you create a Vue.js project with the Vue CLI or UI and select Prettier - you'll have a bunch of ES Lint...
Read more >VS Code - You don't need a formatting extension (Prettier ...
VS Code has builtin formatters for HTML, JavaScript, TypeScript, ... I still avoid Prettier like hell, because working for an agency i have ......
Read more >How I Resolved Vue.js, VSCode, Vetur, Prettyhtml, and ...
From what I could find, there's no way to tell Prettier to not wrap. ... option is js-beautify-html instead of Prettyhtml or Prettier....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Not sure what specifically is broken there? Maybe you’re after
html-whitespace-sensitivity=strict
?Prettier 1.16.4 Playground link
Input:
Output:
Yeah that’s the expected behaviour.