使用editorconfig保持开发环境一致:
1.在webstorm中的使用
打开webStrome > File > settings > Plugins;
在Marketplace中搜索EditorConfig(此时会发现已经默认安装)
若没有安装点击安装
2.只要创建了文件并且IDE也安装并使用了对应的插件,此配置将会强制自动生效
1>创建 .editorconfig 文件
2>配置信息,更多配置可查阅官网
# http://editorconfig.org
root = true
[*] # 表示所有文件适用
charset = utf-8 # 设置文件字符集为 utf-8
indent_style = space # 缩进风格(tab | space)
indent_size = 4 # 缩进大小
end_of_line = lf # 控制换行类型(lf | cr | crlf)
trim_trailing_whitespace = true # 去除行尾的任意空白字符
insert_final_newline = true # 始终在文件末尾插入一个新行
[*.md] # 表示仅 md 文件适用以下规则
max_line_length = off
trim_trailing_whitespace = false
