Normally, in a developers team, it comes important (when more developers are involved, more important comes) the fact of define and maintains a consistent coding style.
Lots of text editors and IDE’s provide the way to set things like charset, indentation, end of the line and etcetera. But the way that sets the charset in Sublime Text could be different in Atom or WebStorm.
The editorConfig project comes to solve this mess, take a look at the description of the project.
“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.”
How looks an editor config file?
.editorConfig file should be in the root of your project.
The supported properties are good enough, here an example of the most used by me:
- Indent style.
- Indent size.
- End of a line.
- Trim trailing white space.
- Final new line.
Not all properties are supported by every plugin, in his wiki you can check a complete list of properties.
Native support? I need a plugin?
Some text editors and IDE’s have native support to read the
.editorconfig file, check on the download page if yours need a plugin.