Skip to content

Commit 88dff2f

Browse files
Update editor-config.md
1 parent 2f395f6 commit 88dff2f

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

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

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ TODO - Can I create one at the user level to share across all repos? Unless `roo
1616
If using VS Code Prettier or related extensions (such as for formatting with semicolons), be sure to set space to 2 and disable tabs in the config. These will be applied when the file is saved and unfortunately the editor config is not picked up.
1717

1818

19-
## Samples
20-
21-
These are separate but can combined if they make sense for one project.
22-
23-
2419
## General format
2520

2621
```ini
@@ -36,12 +31,25 @@ foo = bar
3631
foo = bar
3732
```
3833

39-
Some people like to put this at the top of the file:
34+
Some like to put this at the top of the file before `root`.
4035

4136
```ini
4237
# editorconfig.org
4338
```
4439

40+
## Samples
41+
42+
These are separate but can combined if they make sense for one project.
43+
44+
### Generic
45+
46+
Some like to set this before going into more formats.
47+
48+
```ini
49+
[*]
50+
charset = utf-8
51+
insert_final_newline = true
52+
```
4553

4654
### Shell
4755

@@ -59,6 +67,14 @@ indent_style = space
5967
indent_size = 4
6068
```
6169

70+
### Configs
71+
72+
```ini
73+
[*.{json,yml}]
74+
indent_style = space
75+
indent_size = 2
76+
```
77+
6278
### JavaScript
6379

6480
```ini
@@ -131,7 +147,7 @@ insert_final_newline = true
131147

132148
### Demo
133149

134-
Based on the one of the EditorConfig homepage.
150+
Based on the one on the EditorConfig homepage.
135151

136152
```ini
137153
# EditorConfig is awesome: https://EditorConfig.org

0 commit comments

Comments
 (0)