Create an .editorconfig that standardizes indentation, encoding, and line endings.
Indentation, charset, line-ending, final-newline, and trimming settings are serialized into sections with glob patterns. Later matching sections override broader settings.
Indent style: space Indent size: 2 End of line: lf Charset: utf-8 Trim trailing whitespace: true Insert final newline: true Max line length: 120 Include markdown: true Include makefile: false
# EditorConfig - https://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
[*.md]
trim_trailing_whitespace = false
max_line_length = off
[*.{json,yml,yaml}]
indent_size = 2
[*.{css,scss,less}]
indent_size = 2
Repositories, mixed-language projects, and formatter CI generate EditorConfig files.