admin管理员组文章数量:1291041
I have installed Beautify
to use it for my ReactJS
code.
However, it apparently does not properly beautify the HTML format in the file.
For example, it turns this:
into this:
Among all the options, which option should I use to fix this ?
I have installed Beautify
to use it for my ReactJS
code.
However, it apparently does not properly beautify the HTML format in the file.
For example, it turns this:
into this:
Among all the options, which option should I use to fix this ?
Share Improve this question edited Dec 19, 2022 at 11:25 HedgeHog 25.2k5 gold badges17 silver badges41 bronze badges asked Oct 4, 2018 at 3:58 Jay JeongJay Jeong 1,0042 gold badges13 silver badges27 bronze badges 2- Use atom editor with prettier. atom.io/packages/prettier-atom – Dipak Commented Oct 4, 2018 at 4:03
- Thanks! I don't know why, but as you remended Prettier works better for me. – Jay Jeong Commented Oct 4, 2018 at 4:22
3 Answers
Reset to default 5I used to have the same problem. Apparently beautify doesn't support JSX. I uninstalled and instead of it, I installed Prettier, it works great for me.
Hope I helped you.
Just change language mode javascript to javascript react [temporary]
VSCode Command: (Ctrl + KM)
Or Save file in .jsx format and change the settings.json file
"files.associations": {
"*.jsx": "javascriptreact"
}
For those still struggling with this, there is also js-beautify's -X
(--e4x
) option which tells it to leave the XML content unchanged.
本文标签: htmlHow to use beautify for JavascriptReactStack Overflow
版权声明:本文标题:html - How to use beautify for JavascriptReact? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741510290a2382566.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论