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月12日T15: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
34.6k9 gold badges92 silver badges107 bronze badges
asked Jul 7, 2019 at 18:45

1 Answer 1

1

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

answered Jul 8, 2019 at 3:08
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.