Closing > in new line

穿精又带淫゛_ 提交于 2019-12-01 20:26:15

问题


I have problem with '>' in tags. I got:

<label
    class="custom-control-label"
    for="building{{building.Id}}"
>
 {{ building.City }}, {{ building.Name }}
</label>

How to make label starting tag '>' in the same line as last attribute? I use Prettier, but I neither couldn't find solution in their config nor in code settings.

<label
   class="custom-control-label"
   for="building{{building.Id}}">
     {{ building.City }}, {{ building.Name }}
</label>

Solution: I've used built-in VS Code formatter.


回答1:


That setting in prettier is called jsxBracketSameLine and needs to be set to true

Documentation

https://prettier.io/docs/en/options.html#jsx-brackets




回答2:


You can follow this thread.

This a feature request for Prettier.



来源:https://stackoverflow.com/questions/53366923/closing-in-new-line

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