编辑器设置
按下图打开编辑器配置:
将下面的配置粘贴到配置文件中:
// 适合笔记本的工作环境
"editor.tabSize": 2,
// 避免格式修改和逻辑代码混在一起,解决冲突时非常费事
"editor.formatOnSave": false,
// 按下Tab后输入空格而不是tab:
"editor.insertSpaces": true,
// 失焦保存(可选)
"files.autoSave": "onFocusChange",
// prettiter相关配置:
"prettier.tabWidth": 2,
"prettier.printWidth": 80,
"prettier.singleQuote": true
.editorConfig 文件配置
在项目根目录有一个 .editorConfig文件,打开将以下配置粘贴到该文件中:
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true