Skip to content

Commit

Permalink
feat: Implement the rule "promise"
Browse files Browse the repository at this point in the history
  • Loading branch information
wakamsha committed Mar 7, 2024
1 parent dd35bb2 commit 2952604
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions rules/promise.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
plugins: ['promise'],
extends: ['plugin:promise/recommended'],

rules: {
// Require returning inside each `then()` to create readable and reusable Promise chains.
// https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/always-return.md
// In use cases that don't assume a return value, such as `React.Suspense`, this rule can be confusing.
'promise/always-return': ['warn', { ignoreLastCallback: true }],

// Disallow nested `then()` or `catch()` statements.
// https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/no-nesting.md
// Disallowing nesting may actually increase complexity.
'promise/no-nesting': ['off'],
},
};

0 comments on commit 2952604

Please sign in to comment.