Quantcast
Channel: Active questions tagged vs-code-settings - Stack Overflow
Viewing all articles
Browse latest Browse all 48

VS Code: How to automatically remove double spaces on save?

$
0
0

I want VS Code to automatically correct spaces when saving a JSON file (I do not want this rule to be applied to any other types of files, but this is not crucial)

Example:

// before saving{"someField":       "value"}// after saving{"someField": "value"}

I've searched the internet, and there are lots of articles on how to remove trailing spaces automatically when saving a file. But this is not the case

Solution that worked for me

I added this rule to my settings.json:

"[json]": {"editor.formatOnSave": true}

Viewing all articles
Browse latest Browse all 48

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>