Applying code standards with EditorConfig
Let’s take a look at how you can take the same code style settings found in the options dialog and attach them to a project through an .
editorconfig
file.
The EditorConfig feature uses .editorconfig
files that contain style and language usage rules that apply to your project. Any violation of your EditorConfig
rules will result in compiler warnings and suggestions in the Visual Studio editor.
EditorConfig files outside of Visual Studio
At the time of this writing, .editorconfig
files work in Visual Studio and JetBrains Rider natively. In VS Code, EditorConfig files are supported as long as you install the C# Dev Kit and the EditorConfig for VS Code extension. See the Further reading section for instructions on enabling these features in VS Code and JetBrains Rider.
The key benefit of EditorConfig
files is that they allow all developers working on a project to work with a consistent set of formatting and styling preferences...