Re:Ask HN: What extensions/packs of VS Code are must for web...
by Waterluvian on Friday November 19, 2021 @11:46AM
(#29279187)
Yes, very true. For TypeScript I do use Prettier so yeah, there _is_ an extension involved. For others, this is basically what it takes (plus making the conscious decision to enforce formatting on your repo, which I think you should!):
Install the plugin and add this config:
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
Re:Ask HN: What extensions/packs of VS Code are must for web...
by 0x008 on Friday November 19, 2021 @03:49PM
(#29282270)
What is the benefit of using prettier as opposed to the built in typescript formatter?
Re:Ask HN: What extensions/packs of VS Code are must for web...
by Isthatablackgsd on Friday November 19, 2021 @04:06PM
(#29282495)
I believe it is something to do with style formatting than the syntax formatting. I use VSCodium for HTML/CSS and I use Prettier to "style" it in a particular way. Some will style it into a long code and other will style it in chucks.
https://prettier.io/docs/en/install.html