Search code examples
javascriptwebstormeslint

Allow multiple spaces after comma in ESLint


I have problem with ESLint configuration. I like to put comma in new line before variables, but ESLint don't accepts three spaces (only one space is correct in this case).

What should I add to my ESLint configuration file to allow situation that I can use three spaces instead of one after comma?

enter image description here


Solution

  • As the document mentions, we can specify exceptions by ESTree node types. The comma belongs to VariableDeclaration node.

    "no-multi-spaces": [
        "error", 
        {"exceptions": {"VariableDeclaration": true}}
    ]