VS Code 格式化后 eslint报错,Missing sp
2021-05-25 本文已影响0人
秀萝卜
vscode格式化(ctrl+shift+f)之后,
eslint报错,Missing space before function parentheses
这是因为方法名和括号之间没有空格
fetchCommentCount () { // 像这样fetchCommentCount和()之间有空格 这是我们的目标
return {}
},
只需要在Vscode设置文件Settings中加入以下两句:
"vetur.format.defaultFormatter.js": "vscode-typescript", // 如果使用vue,ts 则这句是必需的
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,