How to add semicolons to Dart code on save automatically?

3.7k Views Asked by At

I am coming from languages that don't use semicolons by default and I keep forgetting adding them all the time. Also it's annoying to type ; all the time.

Is there any VS Code plugin that will add semicolons on save automatically?

If it's not possible in VS Code, is it possible in some other editor like IntelliJ or something?

3

There are 3 best solutions below

4
On

That's not directly possible at the moment. You may try this extension: https://marketplace.visualstudio.com/items?itemName=vmsynkov.colonize

0
On

First, go to the command palette, then search for "setting.json" and add the following in that file:

"editor.codeActionsOnSave": {
  "quickfix.insertSemicolon": true,
}
0
On

For anyone looking for an answer to this problem, add this to your settings.json in VSCode:

"editor.codeActionsOnSave": {
  "quickfix.insertSemicolon": true,
},