vscode保存代码时自动eslint格式化图文教程
作者:不想熬夜不想熬夜
这篇文章主要介绍了vscode保存代码时自动eslint格式化的相关资料,包括打开设置文件并复制特定内容,文中通过代码介绍的非常详细,需要的朋友可以参考下
1、点击设置
2、选择远程--->点击右上角打开设置
3、会弹出settings.json文件,将以下内容复制进去即可
{ "eslint.workingDirectories": [ "./back", "./front" ], "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" }, "eslint.format.enable": true, //autoFix默认开启,只需输入字符串数组即可 "eslint.validate": [ "javascript", "vue", "html" ], "git.useEditorAsCommitInput": false, "editor.snippetSuggestions": "top", "git-graph.commitDetailsView.location": "Docked to Bottom" }
如果碰到eslint失效情况,将back改为backend,front改为frontend,因为对应相关的文件夹
总结
到此这篇关于vscode保存代码时自动eslint格式化的文章就介绍到这了,更多相关vscode保存代码自动eslint格式化内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!