Reputation:
I am new to prettier. I have this strange phenomena in this HTML, after running prettier:
<!DOCTYPE html>
<html>
<head>
<title>X</title>
</head><!-- ddd --->
<body></body>
</html>
Then i run this command:
prettier --write "./src/**/*.{ts,html,scss}"
And the result is this:
<!DOCTYPE html>
<html>
<head>
<title>X</title></head
><!-- ddd --->
<body></body>
</html>
I have this .prettierrc.json file
{
"singleQuote": true,
"trailingComma": "es5",
"endOfLine": "auto",
"bracketSpacing": true,
"printWidth": 120
}
Any suggestions why this behavior occurs? Thank you.
Upvotes: 1
Views: 306
Reputation: 668
Add this option
In command line :
--html-whitespace-sensitivity ignore
Or in your .prettierrc.json
:
htmlWhitespaceSensitivity: "ignore"
Upvotes: 3