.editorconfig Generator
Generate a .editorconfig from a few options.
Overview
An .editorconfig file gives every editor and IDE in your team the same indent style, line ending, and charset rules without any plugin gymnastics. This generator turns a handful of toggles - indent size, end-of-line, charset, trim trailing whitespace - into a syntactically correct .editorconfig you can drop at the repo root.
It's aimed at teams who want consistent formatting across VS Code, JetBrains IDEs, Vim, and Visual Studio without manually authoring section globs. Reach for it when you're spinning up a new repo, normalising indentation on an old one, or onboarding contributors who keep accidentally committing tabs into a spaces codebase.
How it works
The output follows the EditorConfig file format - an INI-like syntax where the top-level root = true flag tells editors to stop searching parent directories, and bracketed sections ([*], [*.{js,ts}]) apply rules to file globs. The generator emits the canonical property names (indent_style, indent_size, end_of_line, charset, trim_trailing_whitespace, insert_final_newline) that the EditorConfig core libraries recognise across all major editors.
Common per-language overrides - Makefiles requiring tabs, Markdown preserving trailing whitespace for hard line breaks - are included as separate sections so you don't have to remember the gotchas.
Examples
- Default web project with 2-space indent:
root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true - Makefile override (tabs are required):
[Makefile] indent_style = tab - Markdown override (preserve trailing whitespace):
[*.md] trim_trailing_whitespace = false - Python 4-space block:
[*.py] indent_size = 4
FAQ
Does Visual Studio respect .editorconfig out of the box?
Yes. VS 2017 and newer read .editorconfig natively. JetBrains IDEs, VS Code (with the EditorConfig extension), Vim, Emacs, and Sublime all support it too.
What does root = true do?
It stops the editor from walking up parent directories looking for more .editorconfig files. Put it at your repo root to make settings self-contained.
Can I override settings in a subdirectory?
Yes - drop another .editorconfig (without root = true) in the subdirectory. Its rules merge with and override the parent file.
Why use this over .prettierrc or .eslintrc?
EditorConfig handles the low-level editor settings (indent, EOL, charset) that fire before any linter runs. Prettier and ESLint sit on top for code-style and lint rules.