Vetur/Eslint/VS Code - can't set space between parenthesis for .vue files Vetur/Eslint/VS Code - can't set space between parenthesis for .vue files vue.js vue.js

Vetur/Eslint/VS Code - can't set space between parenthesis for .vue files


Try this:

npm install prettier@v1.19.1 --save-dev --save-exact

and then restart VS Code.

Prettier just recently updated to v2 and if your project doesn't have prettier installed locally it will use VS Code's version, which is most probably the latest version. In prettier v2 the space-before-function-paren has become a default and hence will be applied on all your projects that don't have a local version of prettier pre v2 installed. For me using any config combination didn't seem to work - it's like prettier just ignored all of them. Hope this helps.


Prior to Prettier v2, It seems to not support space-before-function-paren rule. So We should turn off the rule above to resolve conflict.

Try this

module.exports = {  rules: {    'space-before-function-paren': 'off'  }}

in an ESLint configuration file(such as .eslintrc.js) located in root directory of project.

Then we should add following to settings.json in VS Code.

  "editor.formatOnSave": true,  "editor.codeActionsOnSave": {    "source.fixAll": true  },

Last but not least, Disabling Vetur extension in VS Code might be a better choice.