As of September 2016 (VSCode 1.6), this is now officially supported.
Add the following to your settings.json
file:
"editor.formatOnSave": true
ID : 10111
viewed : 52
Tags : visual-studio-codevscode-settingscode-formattingvisual-studio-code
94
As of September 2016 (VSCode 1.6), this is now officially supported.
Add the following to your settings.json
file:
"editor.formatOnSave": true
82
No need to add commands anymore. For those who are new to Visual Studio Code and searching for an easy way to format code on saving, kindly follow the below steps.
[Cmd+,]
in Mac or using the below screenshot.You are done. Thank you.
77
If you would like to auto format on save just with Javascript source, add this one into Users Setting
(press CmdShiftP or CtrlShiftP then type Open Settings (JSON)
to open settings.json
file)
"[javascript]": { "editor.formatOnSave": true }
62
For eslint:
"editor.codeActionsOnSave": { "source.fixAll.eslint": true }
60
For MAC user, add this line into your Default Settings
File path is: /Users/USER_NAME/Library/Application Support/Code/User/settings.json
"tslint.autoFixOnSave": true
Sample of the file would be:
{ "window.zoomLevel": 0, "workbench.iconTheme": "vscode-icons", "typescript.check.tscVersion": false, "vsicons.projectDetection.disableDetect": true, "typescript.updateImportsOnFileMove.enabled": "always", "eslint.autoFixOnSave": true, "tslint.autoFixOnSave": true }