Skip to main content
Back to Dev generators

Dev

Mock EditorConfig Generator

Tabs-vs-spaces disagreements and Windows CRLF line endings sneaking into a Unix repository are classic sources of noisy, meaningless diffs and linter failures. An .editorconfig file at the repository root tells every supporting editor to use the same basic style settings automatically, with no per-developer configuration required. This tool generates a ready-to-use .editorconfig. Choose between three indent styles: "2 spaces" (common for JavaScript, TypeScript, YAML), "4 spaces" (common for Python, Java), or "tabs" (required for Makefiles and conventional in Go). The generated file includes root = true (which stops EditorConfig from looking in parent directories), a [*] section with the chosen indent style and size, end_of_line = lf, charset = utf-8, trim_trailing_whitespace = true, and insert_final_newline = true. A [*.md] override disables trailing whitespace trimming, because Markdown uses two trailing spaces to force a line break. Copy the output into an .editorconfig file at your repository root. Most editors and IDEs support EditorConfig natively or via a plugin. It works alongside formatters like Prettier and linters like ESLint — handling whitespace and encoding fundamentals so the deeper style rules can focus on code rather than formatting noise.

Read the complete guide — 4 min read

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  1. Choose an indent style.
  2. Click Generate to produce an .editorconfig.
  3. Copy it into your repository root.
  4. Adapt the rules to your conventions.

Use Cases

  • Standardising team coding style
  • Starting a new repository
  • Eliminating style-only diffs
  • Documenting style conventions
  • Learning the EditorConfig format

Tips

  • root = true stops the search going up.
  • It eliminates style-only diffs.
  • It complements linters and formatters.
  • Adapt the rules to your team.

FAQ

what does the generated editorconfig include

root = true at the top, then a [*] section with indent_style (space or tab), indent_size (2 or 4, for space styles), end_of_line = lf, charset = utf-8, trim_trailing_whitespace = true, and insert_final_newline = true. A [*.md] override sets trim_trailing_whitespace = false to preserve Markdown line-break syntax.

why does the markdown section disable trailing whitespace trimming

Markdown uses two or more trailing spaces on a line to produce a hard line break. If an editor trims those trailing spaces, the line break disappears and the Markdown renders differently. The [*.md] override disables trimming for .md files specifically so Markdown formatting is preserved.

does editorconfig replace a linter or formatter like prettier

No — it complements them. EditorConfig handles the very basics that should be consistent across all editors: indentation character, line endings, charset, and trailing whitespace. Prettier and ESLint enforce deeper code-style rules. Many teams use all three: EditorConfig for editor-level consistency, Prettier for formatting, and ESLint for code quality.

does every editor support editorconfig

Most modern editors and IDEs support it either natively (VS Code, JetBrains IDEs, Emacs, Vim) or via a plugin. Check the EditorConfig website for a full list. Editors that do not support it simply ignore the file — it does not break anything. The file only affects editors that can read it.

You might also like

Popular tools from other categories that share themes with this one.

Try these next

More free tools from other corners of the catalog, picked by shared themes.