How to disable prettier settings creating new line of > of html tag?

时光总嘲笑我的痴心妄想 提交于 2020-12-01 09:12:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!