Skip to content

Editorconfig🔗

EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs. The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems.

— https://editorconfig.org/

A typical sample for our projects is available here (adapt on your needs)

 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
; top-most EditorConfig file
root = true

; Unix-style newlines
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_style = space
indent_size = 4

[*.js]
indent_style = space
indent_size = 2

[*.json]
indent_style = space
indent_size = 4

[webpack.config.js]
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.tsv]
trim_trailing_whitespace = false

[*.dump]
indent_style = space
indent_size = 2
tab_width = 2

[VERSION]
insert_final_newline = false

Last update: December 20, 2024