The editorconfig project allows you to standardize general coding standards on a project.
I was working on a project where I needed to follow the PHP PSR-2 standard. This is the
.editorconfig file I used.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|# EditorConfig helps keep your project formatting consistent.|
|# See https://EditorConfig.org|
|# PHP PSR-2 Coding Standards|
|# Author: Sal Ferrarello (@salcode)|
|# You can download this file directly|
|# to your project from the command-line with|
|# curl -O https://gist.githubusercontent.com/salcode/18eaa8cfa3b097da2f58b582197906d7/raw/.editorconfig|
|root = true|
|charset = utf-8|
|end_of_line = lf|
|insert_final_newline = true|
|trim_trailing_whitespace = true|
|indent_style = space|
|indent_size = 2|
|indent_size = 4|
|trim_trailing_whitespace = false|
For WordPress projects, I use my WordPress .editorconfig.
Leave a Reply