How to Insert Newline at the End of Files in Visual Studio Code(VS Code)

Insert-newline-visual-studio-code-feature-image

A Developer asked on Stackoverflow platform : –

When saving a file using Visual Studio Code, a newline is not automatically added to the end of the file, causing all sorts of potential issues. How can I append a newline automatically in Visual Studio Code?

The solution to this problem is simple:

Go to FilePreferenceSettings → search for “newline”:

Check the “Insert final newline” option – “When enabled, insert a final new line at the end of the file when saving it”.

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 2

No votes so far! Be the first to rate this post.

Similar articles you may like

By Sunil Pradhan

Hi there 👋 I am a front-end developer passionate about cutting-edge, semantic, pixel-perfect design. Writing helps me to understand things better.

Leave a comment

Your email address will not be published. Required fields are marked *

Exit mobile version