rt,已配置自动保存,且已配置 insertSpaceBeforeFunctionParenthesis
.vscode/settings.json
编辑器配置
{
"scss.lint.unknownAtRules": "ignore",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
},
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"typescript.format.insertSpaceBeforeFunctionParenthesis": true,
"npm.packageManager": "pnpm",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true
}
但是在 ts 文件中声明方法,保存后还是会将方法名和括号之间的空格删掉……
// 保存前
function test () {}
// 保存后
function test() {}