Vs code remove space

when i click ctrl + s …all the space in the code eiditor removed why that?!!

What do you mean by “all the space in the code eiditor removed”? Do you mean:

  const greeting = 'How are you doing?';

… becomes …


If so, I have no idea what is causing that. That being said, I do have my VSC editor set up to remove trailing whitespace. But it only removes spaces from the end of the line. If you go into settings, you can search for “trim trailing whitespace” and check the setting. You could also search for “space”. The only other thing is you might have some weird package installed - I might disable them all and see if it goes away.

Check your config, maybe you have a code formater