Skip to content

Commit 5ebde5e

Browse files
Update editor-config.md
1 parent 34eb479 commit 5ebde5e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

recipes/format-and-lint/editor-config.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ Pick from some of these sample files and add as `.editorconfig` in your project.
7474

7575
I find this a good starting point for adding a file to a project and then refining it.
7676

77-
#### Python-focused projects
77+
#### Focus on 4-spaces
7878

79-
It supports an explicit default of 4 spaces such as for Python or Markdown files and an override for JavaScript and JSON files.
79+
If most of your file types use 4-spaces, use this.
8080

8181
```ini
8282
root = true
@@ -92,10 +92,13 @@ indent_size = 2
9292
indent_style = tab
9393
```
9494

95+
If your 2-space block below starts growing, consider using the section covered next.
96+
97+
#### Focus on 2-spaces
9598

96-
#### JS-focused projects
99+
Even if most of the files by count use 4 spaces, if most of your file types use 2 spaces then use this.
97100

98-
If most of the project's scripts (shell, JS, TS) and configs (YAML and JSON) use 2 spaces, then it makes sense to use `2` as the default. And set exceptions for `.md`, `.html` and `.py`.
101+
This handles shell, JS, Ruby, CSS, config files, etc. without setting them explicitly.
99102

100103
```ini
101104
root = true

0 commit comments

Comments
 (0)