1.多IDE间的coding规范
创建文件.editorconfig: 定义编码方式utf-8
vscode 插件: EditorConfig For vscode
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
2.vscode 在保存时Prettier自动格式化:
settings => 勾选 Format on Save => 勾选 Default Format
npm install perttier -D
vscode 插件: Prettier Code Format
{
"useTabs": false,
"tabWidth": 2,
"printWidth": 80,
"singleQuote": true