Cross-editor configuration file defining coding style preferences like indentation, line endings, and character encoding to maintain consistent formatting across different editors and IDEs.
.editorconfig
EditorConfig is a simple, widely-supported convention for keeping coding style consistent across a team no matter which editor or IDE each person prefers. You drop an .editorconfig file at the root of a repository, declare a handful of formatting rules, and every compatible editor reads and applies them automatically. It answers one small but persistent question in collaborative work: whose indentation wins?
- A plain-text
.editorconfigfile - INI-style sections keyed by file glob, committed to the repository alongside the code it governs. - A core set of properties -
indent_style,indent_size,end_of_line,charset,trim_trailing_whitespace, andinsert_final_newlinecover the formatting that most style arguments are actually about. - Cascading, root-scoped resolution - Files are matched from the current directory upward until an entry with
root = truestops the search, so nested projects can override the defaults. - Broad editor support - Honored natively or via plugin across VS Code, JetBrains IDEs, Vim, and most other editors, so the rules travel with the code rather than living in personal settings.
In API operations, EditorConfig shows up as the quiet baseline beneath the more visible governance layers. Consistent indentation and line endings keep hand-edited OpenAPI, AsyncAPI, and JSON Schema files diff-clean and reviewable, which matters when those artifacts are the contract. It pairs naturally with linters and formatters that enforce deeper rules, giving a repository a predictable shape before any OpenAPI style checks or CI governance ever run.