I use Visual Studio Code with Vetur extension, when I right click on my .vue file and chose "Format Document" option Visual Studio Code automatically add the semicolons that intentionally removed them.
How do I stop this?
I use Visual Studio Code with Vetur extension, when I right click on my .vue file and chose "Format Document" option Visual Studio Code automatically add the semicolons that intentionally removed them.
How do I stop this?
Put this in your user settings and it won't change your semis:
"vetur.format.defaultFormatter.js": "vscode-typescript",
Forget the earlier answer, gives me runtime issues.
Install Prettier- code formatter extension and disable the addition of semi colons by unchecking the Prettier:Semi as in the screenshot below
Note : Dont forget to reload your vs code after you install the extension and before u do the config changes
Adding .prettierrc file in project root worked for me with following settings:
{
"semi": false,
"singleQuote": true
}
Changing prettier settings in VSCode Workspace did not work in my case.
"javascript.format.semicolons": "remove",
"typescript.format.semicolons": "remove",
"typescriptHero.imports.insertSemicolons": false,
"typescript.preferences.quoteStyle": "single",
"javascript.preferences.quoteStyle": "single",
You can add in your VSCode settings.json
"vetur.format.defaultFormatterOptions": {
"prettier": {
"semi": false
}
},
May be, you have different extensions installed where the usage of semicolons (;) is defined. Try to go to VSCode settings and search for "semicolon". All settings regarding the usage of semicolon will be shown and you can configure it as you like.
Add this line to your custom settings in VSCode (helps with js files):
"autoimport.useSemiColon": false
setting organizedimports to false worked for me
"editor.codeActionsOnSave": {
"source.organizeImports": false
},
Easiest fix is go to "Settings" in vs code, Search for ";"
In the search result that follows, remove ";" as demonstrated in the below screenshots.
Before the change:

After the change:
