VsCode 配置

settings.json 中配置

1. esLint 保存自动 格式化

1
2
3
4
5
6
7
8
// #每次保存的时候将代码按eslint格式进行修复
"eslint.autoFixOnSave": true,
"files.autoSave": "off",或者 设为 "onFocusChange" 聚焦发生才保存,这是以防bug的,
可以切换成其他的 autoSave项目。
"files.insertFinalNewline": true, // 文件的最后一行空一行
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},

2. 保存不格式化 save without format

代码编辑页面—->按 F1—->输入save without formatting—->回车
该操作可以用快捷键

关闭自动格式化

代码编辑页面—->按 F1—->输入Formatter config—->回车—->“onSave”属性设置为false


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!