You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: recipes/format-and-lint/editor-config.md
+23-7Lines changed: 23 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,6 @@ TODO - Can I create one at the user level to share across all repos? Unless `roo
16
16
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.
17
17
18
18
19
-
## Samples
20
-
21
-
These are separate but can combined if they make sense for one project.
22
-
23
-
24
19
## General format
25
20
26
21
```ini
@@ -36,12 +31,25 @@ foo = bar
36
31
foo = bar
37
32
```
38
33
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`.
40
35
41
36
```ini
42
37
# editorconfig.org
43
38
```
44
39
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
+
```
45
53
46
54
### Shell
47
55
@@ -59,6 +67,14 @@ indent_style = space
59
67
indent_size = 4
60
68
```
61
69
70
+
### Configs
71
+
72
+
```ini
73
+
[*.{json,yml}]
74
+
indent_style = space
75
+
indent_size = 2
76
+
```
77
+
62
78
### JavaScript
63
79
64
80
```ini
@@ -131,7 +147,7 @@ insert_final_newline = true
131
147
132
148
### Demo
133
149
134
-
Based on the one of the EditorConfig homepage.
150
+
Based on the one on the EditorConfig homepage.
135
151
136
152
```ini
137
153
# EditorConfig is awesome: https://EditorConfig.org
0 commit comments