7

How do I configure eslint to:

Promise.all(promises)
.then(() => {
  myExampleFunction()
})

instead of:

Promise.all(promises)
    .then(() => {
      myExampleFunction()
    })

We are using the following eslint packages:

"eslint": "4.12.0",
"eslint-plugin-promise": "3.6.0",
"eslint-plugin-react": "7.5.1",
"eslint-plugin-react-native": "3.2.0",
Waltari
  • 1,052
  • 1
  • 30
  • 64

1 Answers1

13

You can set MemberExpression to 0 as per documentation

"Indent of 2 spaces with MemberExpression set to 0 will indent the multi-line property chains with 0 spaces." - indent - Rules

as inline comment /*eslint indent: ["error", 2, { "MemberExpression": 0 }]*/

in .eslintrc "rules": {"indent": ["error", 2, { "MemberExpression": 0 }]}

mjabadilla
  • 1,006
  • 14
  • 31