r/VisualStudioCode • u/MatrixSolution • Jan 22 '23
How do I add semicolons in Javascript?
I've been learning Javascript for 10 weeks now.
I was told semicolons were optional.
I've got in a habit of leaving them out everywhere!
Now... I learn that it is highly advisable to add semicolons 🤦
I'm finding it hard to kick the first habit of leaving out semicolons!
What can I use to add semicolons automatically?
I've got the standard code prettier extension. I think I've got it tweaked so that braces appear on a new line. I'm guessing it will be the same extension that I need to use to add semicolons?
Thanks.
0
Upvotes
View all comments
Show parent comment
1
u/MatrixSolution Jan 27 '23
Oooh, very nice.
Apologies, where do I put
prettier --write **/*.js?I'm loving VSCode - but I'm a newbie to that as well.
In regards to semi colons, I've nearly broken my habit. It doesn't feel strange adding semicolons anymore. But getting prettier to work would be good.
Thanks.