我們在 Atom 上安裝一個叫EditorConfig的插件,在進行團隊協作開發時,這個插件能起到很大作用。安裝完成之后,我們需要在 Laravel 應用的根目錄下添加.editorconfig文件,并寫入如下的配置信息。
.editorconfig
# coding styles between different editors and IDEs
# editorconfig.org
root=true
[*]
# Change these settings to your own preference
indent_style=space
indent_size=4
# We recommend you to keep these unchangedend_of_line=lf
charset=utf8
trim_trailing_whitespace=true?
insert_final_newline=false
[*.{js,html,blade.php,css,scss}]
indent_style=space
indent_size=2
[*.md]
trim_trailing_whitespace=false
接著讓我們將該文件加入到版本控制中。
$gitadd -A$gitcommit -m"Add .editorconfig"