Generate an .editorconfig file — consistent indentation, line endings and charset across editors.
How to use this tool
Spaces or tabs, and how wide one indent level is.
lf for Unix/macOS, crlf for Windows; utf-8 in almost all cases.
Trim trailing whitespace and insert a final newline are the usual defaults.
Save it in your project root and commit it.
Formula & worked example
Space indent, size 2, lf, utf-8 gives a [*] section with indent_style = space, indent_size = 2, end_of_line = lf, charset = utf-8, trim_trailing_whitespace = true and insert_final_newline = true, under root = true.
Limitations — read this before you rely on it
EditorConfig only sets editor behaviour (indent, line endings, charset, whitespace) — it does not format code, enforce lint rules or reformat existing files on its own. Per-language sections beyond [*.md] are not generated here; add them by hand.
Frequently asked questions
A standard file (.editorconfig) that tells editors to use the same indent, line endings and charset, so a project looks consistent across editors.
Many modern editors support it natively; some need a plugin. Check your editor's EditorConfig support.
No. It sets editor behaviour for new edits; it does not run a formatter over existing files. Pair it with Prettier or your linter for enforcement.
Two trailing spaces in Markdown mean a hard line break, so trimming them changes rendering. The [*.md] section disables trimming there.
It stops EditorConfig from looking for settings in parent folders above your project root.
