EditorConfig

No Change
adopt
First Added:October 1, 2024 Updated: May 17, 2026

EditorConfig is a repo-root .editorconfig file plus editor plugins that apply shared whitespace, encoding, and newline rules before language formatters or linters run. We adopt it as the bottom layer of Code Linting: cheap consistency across VS Code, Cursor, JetBrains, and vim without debating tabs in every PR.

Blurb

EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.

Summary

What it fixes: UTF-8 vs Latin-1 surprises, CRLF vs LF churn, trailing whitespace noise, and “my editor used 2 spaces, yours used 4” diffs. It does not replace ESLint, Prettier, golangci-lint, or Super-Linter; it sets the baseline those tools assume.

Why adopt:

BenefitDetail
VCS-friendlySmall text file; merges are rare
Editor-agnosticPlugins for most IDEs; native support in some
Shift leftApplies on save locally, same rules in Dev Container if the plugin is installed
Pairs with CILinters still enforce logic; EditorConfig reduces formatting-only failures

Rules of thumb:

  • Commit .editorconfig at repo root with root = true.
  • Use globs per language ([*.{js,ts}], [*.go], [*.md]).
  • Do not duplicate every Prettier option; let formatters own language semantics.
  • Document team choices in Code Linting standards, not in wiki-only tables.

Details

Example baseline (team defaults; adjust per repo):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[*.md]
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
PropertyTypical use
indent_style / indent_sizeSpaces vs tabs per language
end_of_linelf for cross-platform repos
charsetutf-8 default
trim_trailing_whitespaceCleaner diffs (often off for .md if needed)
insert_final_newlinePOSIX text files; may differ for * vs *.md

Monorepos: nested .editorconfig in packages is allowed; closest match wins. Prefer one root file unless a subtree truly needs different EOL rules.

CI: optional editorconfig-checker in GitHub Actions if editors without plugins are common; most teams rely on linters plus local plugins.

Not the same as: .gitattributes (Git checkout normalization); Prettier config; Policy as Code.

Garden pattern: adopt .editorconfig on every new service repo before adding language linters. Listed under Code Linting editor baseline row.

References