问题
I walk through the Prettier extension of Vscode and I can't find how to disable this scenario. See the > of html tag.
Here's a sample code that needed some fix, every time i run the Prettier. The output is this:
<tag-html
[val1]="valueStr"
[val2]="valueStr"
>
</tag-html>
I want Prettier to output:
<tag-html
[val1]="valueStr"
[val2]="valueStr">
</tag-html>
回答1:
This can be done with help of VS Code itself. Place the following entry in your workspace settings in your vs code.
"html.format.wrapAttributes": "force-aligned"
You don't need any external plugins or extension to do this.
Or you can use the GUI settings page as well
UPDATE 01
Based on github issue in prettier repo https://github.com/prettier/prettier-vscode/issues/646
you can still merge the settings I have mentioned above.
来源:https://stackoverflow.com/questions/53927236/how-to-disable-prettier-settings-creating-new-line-of-of-html-tag