EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs. Many editors and IDEs support it natively, and many others support it via plugins.
Check editorconfig.org to see if your text editor or IDE has built-in support or requires a plugin. For convenience, here are some shortcuts to plugins for some commonly-used editors:
Here's a sample .editorconfig
that can be dropped into your projects. The EditorConfig wiki includes a complete list of properties that you can use to customize your specific project.
# EditorConfig is awesome:
# http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.html]
indent_size = 2
[*.{js,jsx}]
indent_size = 2
[*.md]
max_line_length = off
trim_trailing_whitespace = false