Here is a nice little trick to share your IDE’s configuration. Use an .editorconfig file.

It is supported by default by Webstorm which is my IDE of choice, but there are plugins for almost any other editor.

With this file, you will be able to tell you editor, if it should use tabs or spaces, what is the indent size and the charset to be used. It should be placed at the root of your project.

Here is an example with comments:

.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
# Set to true to
root = true
# Indicates that the following rules will apply to all files
[*]
# Choose in between tab or space
indent_style = space
# number of columns used per indentation level
indent_size = 4
# line break representation
end_of_line = lf
# character set
charset = utf-8
# Remove whitespace at the end of lines
trim_trailing_whitespace = true
# Insert a line at the end of a file
insert_final_newline = false
# applies to files with the .md extension
[*.md]
trim_trailing_whitespace = false
# applies to js files inside the src folder
[src/**.js]
trim_trailing_whitespace = true
# applied to package.json and .travis.yml
[{package.json,.travis.yml}]
indent_size = 2

That is basically all the properties and syntax supported, easy enough. You don’t have to restart Webstorm as it will pick up the config automatically.

Check out this page for more information on each property.