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: 1

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 ๐Ÿ‘‹ My name is Sunil and I'm a front-end developer who loves to help others by simplifying web-dev related topics.

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 ๐Ÿ‘‹ My name is Sunil and I'm a front-end developer who loves to help others by simplifying web-dev related topics.