Is there a feature / extension for Visual Studio 2017 to automatically end files with a newline?
I'm looking for a similar option as with VS Code's "Insert Final NewLine"
Thanks!
There is a feature called "EditorConfig" that allows placing a file in specific locations that allow to set various configurations about how to format files. In particular, one of them is to end files with a new line. To activate it, create a file named .editorconfig
in the root of your solution and add this content:
root = true
[*]
insert_final_newline = true
To apply a trailing newline to every single file in the solution.
Look at the full documentation of the feature for details and other options.
Note that such formating actually happens when you format the whole document, not on its own as you write.
For previous versions of Visual Studio, there is an extension that does the very same thing. It's bundled begining with VS2017.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With