What is EditorConfig?
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.
EditorConfig is great because:
- It’s a simple tool that does one thing well with a clear syntax and a
flat learning curve. You install the appropriate plugin for your editor,
added a brief
.editorconfigfile to your project, and is ready to go in a couple minutes.
- It just works. “Set it and forget it” and your project’s coding standards are documented alongside your project’s code.
- EditorConfig is a great option for large, diverse teams. Since the project’s coding styles are specified in a file with the project’s codebase in a format enforced by an editor or IDE, team members can stop fretting over whether or not they’re using the “correct” indentation and instead get down to the business of writing code and solving problems.
When opening a file, EditorConfig plugins look for a file named
in the directory of the opened file and in every parent directory.
A search for
.editorconfig files will stop if the root filepath is
reached or an EditorConfig file with
root=true is found.
The common practice is to put
.editorconfig at the root of your project.