Skip to content
Logo Theodo

One file to rule them all

Vincent Langlet2 min read

Why use EditorConfig?

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!

project_settings

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…

How does it work?

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.

editorconfig_example

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.

You said plugins?

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?

Liked this article?