Skip to content

Commit

Permalink
add eslint-plugin-promise
Browse files Browse the repository at this point in the history
...and enable basic rules
  • Loading branch information
yaacovCR committed Dec 9, 2022
1 parent bac9ad6 commit b71b510
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins:
- node
- import
- simple-import-sort
- promise
settings:
node:
tryExtensions: ['.js', '.ts', '.jsx', '.json', '.node', '.d.ts']
Expand Down Expand Up @@ -177,6 +178,27 @@ rules:
- ["^\\./"]
simple-import-sort/exports: off # TODO

##############################################################################
# `eslint-plugin-promise` rule list based on `v6.1.x`
# https://github.com/eslint-community/eslint-plugin-promise/blob/main/README.md
##############################################################################

promise/always-return: off
promise/avoid-new: off
promise/catch-or-return: error
promise/no-callback-in-promise: error
promise/no-multiple-resolved: error
promise/no-native: off
promise/no-nesting: error
promise/no-new-statics: error
promise/no-promise-in-callback: off
promise/no-return-in-finally: error
promise/no-return-wrap: error
promise/param-names: off
promise/prefer-await-to-callbacks: off
promise/prefer-await-to-then: off
promise/valid-params: error

##############################################################################
# ESLint builtin rules list based on `v8.27.x`
##############################################################################
Expand Down
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"eslint-plugin-import": "2.26.0",
"eslint-plugin-internal-rules": "file:./resources/eslint-internal-rules",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "7.31.10",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-simple-import-sort": "8.0.0",
Expand Down

0 comments on commit b71b510

Please sign in to comment.