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

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

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 File β†’ Preference β†’ Settings β†’ search for “newline”:

Insert-newline-visual-studio-code-img-1

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.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Similar articles you may like

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.

Add comment

Stay Updated

Want to be notified when our article is published? Enter your email address below to be the first to know.

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.