To achieve this desired outcome, first install the trailing spaces extension.
After that is installed, open VScode commands (mac shortcut I use is cmd+shift+p) and navigate to Preferences: Open User Settings. When you select this a settings.json file will be displayed.
Add this to the object:
Or if this is your first update to the file create the whole object:
Now all that’s left to do is give it a try.