Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Visual Studio Code From Automatically Adding Semicolons In .vue Files

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?

like image 954
Engr.MTH Avatar asked Nov 05 '17 14:11

Engr.MTH


People also ask

How do I turn off auto format in Vscode?

Enable/Disable Format On SaveOpen up VSCode Command Palette by pressing Ctrl + Shift + P. Search and select Open Settings (UI). Just start typing and it will auto-fill. Once there's a match, you can hit enter immediately, or manually click on the right option.

How do you automatically add a semicolon in Vscode?

Settings -> in Search bar type: 'semicolon' -> change values to 'insert' for both JS and TS, save and close. Now every time on save, VSCode will look for missing semicolons inside the file you're in and append them.

How do I stop apps from running Vscode?

VS Code maintains a debug session while the program is running, and pressing the Stop button terminates the program.


2 Answers

Put this in your user settings and it won't change your semis:

"vetur.format.defaultFormatter.js": "vscode-typescript", 
like image 168
KM3 Avatar answered Sep 20 '22 19:09

KM3


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

enter image description here

like image 22
Gurudutt Shenoy Avatar answered Sep 17 '22 19:09

Gurudutt Shenoy