- Open VS Code.
- Click on File.
- Then find Preferences -> settings.
- Click on the Text Editor in the left side menu.
- Then Click on Files.
- Locate the Trim Final Newlines Setting.
- Check or Uncheck: When enabled, will trim all new lines after the final new line at the end of the file when saving it.