Enforce consistent coding styles across a team using EditorConfig files in Visual Studio

In Visual Studio if you want to enforce consistent coding styles in a project or solution check out EditorConfig files. An EditorConfig file can be checked into source control and it overrides local VS settings which means all developers don’t need to change their settings to align.. AWESOME!!!

… and since VS 2019 16.10 EditorConfig files now have a user interface so we don’t need to edit the files directly.

To run the formatting options you need to format document via Edit-> Advanced -> Format Document or click Ctrl+K,Ctrl+D or by running code cleanup.

An example of what the interface looks like is below.

One thought on “Enforce consistent coding styles across a team using EditorConfig files in Visual Studio”

Leave a Reply

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