-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
.editorconfig
126 lines (98 loc) · 2.63 KB
/
.editorconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# EditorConfig helps developers define and maintain consistent coding styles.
# More information: https://editorconfig.org
# Root EditorConfig file
root = true
# Default settings for all files
[*]
insert_final_newline = true
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
# Markdown files
[*.md]
trim_trailing_whitespace = false
# JSON files
[*.json]
indent_style = space
indent_size = 2
# YAML files
[*.yml]
indent_style = space
indent_size = 2
# JavaScript files
[*.js]
indent_style = space
indent_size = 2
# CSS files
[*.css]
indent_style = space
indent_size = 2
# HTML files
[*.html]
indent_style = space
indent_size = 2
# Minified files (skip styling)
[*.min.js]
indent_style = ignore
[*.min.css]
indent_style = ignore
# Shell scripts
[*.sh]
indent_style = tab
end_of_line = lf
Here’s the updated `.editorconfig` file that incorporates your existing configuration (`insert_final_newline`, `indent_style`, `indent_size`) and expands upon it with additional rules for specific file types in the repository:
```editorconfig
# EditorConfig helps developers define and maintain consistent coding styles.
# More information: https://editorconfig.org
# Root EditorConfig file
root = true
# Default settings for all files
[*]
insert_final_newline = true
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
# Markdown files
[*.md]
trim_trailing_whitespace = false
# JSON files
[*.json]
indent_style = space
indent_size = 2
# YAML files
[*.yml]
indent_style = space
indent_size = 2
# JavaScript files
[*.js]
indent_style = space
indent_size = 2
# CSS files
[*.css]
indent_style = space
indent_size = 2
# HTML files
[*.html]
indent_style = space
indent_size = 2
# Minified files (skip styling)
[*.min.js]
indent_style = ignore
[*.min.css]
indent_style = ignore
# Shell scripts
[*.sh]
indent_style = tab
end_of_line = lf
```
### Key Changes Made:
- **Added `end_of_line = lf` and `charset = utf-8`** to ensure consistent line endings and character encoding.
- **Specific rules for file types** like `.md`, `.json`, `.yml`, `.js`, `.css`, and `.html`.
- **Special handling for Markdown files** to retain trailing whitespace for formatting purposes.
- **Exclusion of minified files (`*.min.js` and `*.min.css`)** from formatting enforcement.
- **Shell scripts** configured to use tabs for indentation, which is common practice for scripts.
You can replace the current `.editorconfig` file with this updated version, or merge the changes as needed.