链式 then promise 调用的 ESLint 规则

ES Lint rule for chained then promise calls

我正在搜索将强制执行以下行为的 ES Lint 规则:

aPromiseCall()
   .then(() => {
       // logic
   })
   .then(() => {
       // logic
   })
   .catch(() => {

   })

请注意,每个 .then 应缩进 4 个空格,并在 .单独的行

使用以下规则:

"indent": ["error", 4, { "MemberExpression": 1 }]

"MemberExpression" (default: 1) enforces indentation level for multi-line property chains. This can also be set to "off" to disable checking for MemberExpression indentation.

https://eslint.org/docs/rules/indent#memberexpression