赞
踩
启动 vscode 打开项目,
windows: ctrl + shift + p 打开 搜索面板
mac: command + shift + p 打开 搜索面板
输入 settings.json,选择 User 下的 settings.json
加入以下代码:
- {
- // #每次保存的时候将代码按eslint格式进行修复
- "editor.codeActionsOnSave": {
- "source.fixAll.eslint": true
- }
- }
这个规则是在保存时按照你的项目中 eslint 配置fix
注意你~/Library/Application Support/Code/User/settings.json 中的规则尽量不要与项目中的规则产生冲突
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。