Programster's Blog

Tutorials focusing on Linux, programming, and open-source

EditorConfig

EditorConfig is a standard file format supported by multiple IDEs, including PhpStorm, which helps maintain code styling standards for multiple developers. It does this by telling the IDE various settings to adhere to. All one has to do is create a .editorconfig file at the top level of your codebase.

Below is my default file that I will include in projects.

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.php]
max_line_length = 120

[*.md]
max_line_length = 100

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
Last updated: 2nd March 2022
First published: 2nd March 2022

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch