✅ How can I make VSCode auto add semicolons to statements on save?
I'm coming from the world of Javascript and Typescript. There, you can just use Prettier to automatically add semicolons. I don't like having to manually add a semicolon to every statement. Can I automatically have semicolons added to statements on save in VSCode?
5 Replies
no, there is nothing that does that
semicolons are not optional in C#, which makes it not very easy to do. the formatter would be guessing where they go. you can come up with many instances where it's not clear where the semicolon should be inserted
in TypeScript the code has meaning even without semicolons, it's just a formatting choice, so it's something a formatter can reasonably claim to do correctly
you'd get errors all the time while writing, which would make for a pretty bad experience
with enough time it'll just become a habit
I can't remember the last time I forgot to add one
Imagine hitting enter, and if the end of the line lacks a semicolon, it deletes the line 💀
Ooh ooh, unterminated lines should be a certain tinge of color!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.