prettier-vscode: Unable to add a space before function parens
Default behavior for ESLint is to add a space before function parens. This is also a defined rule with StandardJS.
eslint space-before-function-paren
Currently, if you use the Prettier VS Code extension and enable "editor.formatOnSave": true
in your settings.json the space between the function name and parens is removed on save. There is no way to control this behavior in Prettier.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 29
- Comments: 35 (3 by maintainers)
Even when I add
spaceBeforeFunctionParen
astrue
in the.prettierrc
file, when running Format Document in avue
file, the space between the keywordfunction
and the parenthesis is removed. So fromdata () {}
(which is what I need so ESLint doesn’t complain) it turn intodata() {}
. 😦This isn’t a problem with linting as much as it is a case of overreach and lack of configurability. The whole point of the original post is that it is turning an export into a function call, which changes the execution of that line of code.