I have the following config setting:
"vetur.format.js.InsertSpaceBeforeFunctionParenthesis": false
when formatting the following code:
<script>
var add = function (a, b) {
return a + b;
};
export default {
name: 'hello',
methods: {
login(event) {
console.log(event);
}
},
data() {
return {
msg: 'Welcome to Your Vue.js App!!!' + add(12, 14)
};
}
};
</script>
It removes correctly the spaces in login or data, but it adds a space before parenthesis in the standard add function.
PS: When vetur.format.js.InsertSpaceBeforeFunctionParenthesis is true everything is consistent
Thanks. I can confirm it's working as expected in ts file but not vue file.
That space is controlled by InsertSpaceAfterFunctionKeywordForAnonymousFunctions in TS formatter setting, not InsertSpaceBeforeFunctionParenthesis.
I've made it so that InsertSpaceBeforeFunctionParenthesis would control both, so now Vetur should be consistent for space before function. Will be available in 0.9.5.
Hi i'm on Vetur 0.10.1 and I don't see InsertSpaceBeforeFunctionParenthesis in config options
@BruceHem
"vetur.format.defaultFormatter.js": "vscode-typescript",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true
Most helpful comment
@BruceHem