Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prettier: Add space between function and parenthesis

Tags:

prettier

In VSCode, each time I save a JS file, Prettier removes the space between the function keyword and its parenthesis.

It changes this:

function (parameter)

To this:

function(parameter)

But I want to keep the space.

Some people are suggesting adding this rule to VSCode setting:

"prettier.spaceBeforeFunctionParen": true

But apparently this rule doesn't exist any more.

How can I force a space between function and parenthesis in Prettier?

like image 584
user1941537 Avatar asked May 22 '19 21:05

user1941537


1 Answers

in setting.json add

    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    }

after, when you save your work, eslint fix your error like space before function parenthese.

like image 60
Shoooryuken Avatar answered Sep 28 '22 02:09

Shoooryuken