Posted by Anuraj on Saturday, March 11, 2017 Reading time :1 minute
This post is about .editorconfig support in Visual Studio 2017. EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. As part of productivity improvements in Visual Studio, Microsoft introduced support for .editorconfig file in Visual Studio 2017.
Unlike earlier versions, Visual Studio 2017 comes with a coding style configuration option, which you can access from Tools > Options.
The .editorconfig file overrides this settings, which helps you to keep the coding style consistant across every one in your team.
To get started, you can create a .editorconfig file in your root directory and configure the coding style. You can find more details about the Style Settings in the docs
EditorConfig files use an INI format that is compatible with the format used by Python ConfigParser Library. EditorConfig files should be UTF-8 encoded, with either CRLF or LF line separators. Here is the format, and possible values.
Here is one I have created for the demo purposes.
In this I am enforcing 3 coding styles.
root = true specifies this editorconfig file is the root one. And here is the output.
You must close and reopen any open files to have EditorConfig settings apply once it is added or edited.
Happy Programming :)