March 01, 2016Vincent Langlet1 min read
Developers do not want to take time to define and maintain consistent coding styles. But what if:
Yes, you can set project settings, and ask your team to do the same. But there is a better way!
Indeed, you can create an .editorconfig file in your project directory with all the coding rules you want to be respected.
You won't be the first to use it, look at all these projects using EditorConfig...
It's simple to use and EditorConfig gives a really clear example.
This file is setting end-of-line and indentation styles for JS and Python.
There are two useful tips to know:
The search will stop if the root filepath is reached or when an option root=true is found.
Depending on the editor you use, you might have to install a plugin.
A lot of editors are supported, like Atom, Eclipse, Emacs, PhpStorm, SublimeText, Vim or Xcode.
You're using BBEdit, CLion, GitHub, IntelliJIDEA, RubyMine, SourceLair or WebStorm? Good news, you don't have to do anything.
So now, what is your excuse for not using it?
Web Developer at Theodo