1

I am using visual studio code for my Node JS application with mustache templating. I have below code in one of my html files :

<script>
 {{{interface}}}
</script>

Due to auto formatting on save, it turns out to be a below (space added between braces):

<script>
     { { { interface } } }
  </script>

This is giving below error on browser console:

Uncaught ReferenceError: interface is not defined

I have tried to set editor.formatOnSave to false but could not find this switch.

Below is my version info on VS Code:

Version: 1.35.1 (system setup)
Commit: c7d83e57cd18f90026a8162d042843yui1bcf27m
Date: 2019-06-12T15:16:14.389Z
Electron: 3.1.8
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT ia32 10.0.17134

How to get rid of this auto format feature on save?

Gama11
  • 31,714
  • 9
  • 78
  • 100

1 Answers1

0

There is definitely a setting for that option. See picture below.

Note that VS Code provides two different scopes for settings:

  • User Settings - Settings that apply globally to any instance of VS Code you open.

  • Workspace Settings - Settings stored inside your workspace and only apply when the workspace is opened.

Also please see the Edit in settings.json settings at the end of the screen. If you switch to older view you can manually edit the settings file. See answer for that

format on save settings

eenagy
  • 912
  • 1
  • 8
  • 22