VSCode with EditorConfig
What is EditorConfig?
EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs. The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems. (Excerpt from official documentation)
Using
-
Install EditorConfig
-
Create a
.editorconfig
file in the root directory of the project
-
Check the
Enable Editor Config Support
-
Add coding rules
Refer to the official documentation.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16root = true
[*]
end_of_line = crlf
insert_final_newline = true
[*.cs]
indent_style = space
indent_size = 4
charset = utf-8-bom
trim_trailing_whitespace = true
dotnet_sort_system_directives_first = true
...
Other
- Check the
Organize Imports On Format
to sortusing
.
References
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.