项目根目录创建.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 unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[*.{js,html,blade.php,css,scss,vue}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false