Skip to content

Commit eea0e14

Browse files
committed
add eslint-plugin-promise
...and enable basic rules
1 parent 5f90143 commit eea0e14

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

.eslintrc.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ plugins:
99
- node
1010
- import
1111
- simple-import-sort
12+
- promise
1213
settings:
1314
node:
1415
tryExtensions: ['.js', '.ts', '.jsx', '.json', '.node', '.d.ts']
@@ -177,6 +178,27 @@ rules:
177178
- ["^\\./"]
178179
simple-import-sort/exports: off # TODO
179180

181+
##############################################################################
182+
# `eslint-plugin-promise` rule list based on `v6.1.x`
183+
# https://github.com/eslint-community/eslint-plugin-promise/blob/main/README.md
184+
##############################################################################
185+
186+
promise/always-return: off
187+
promise/avoid-new: off
188+
promise/catch-or-return: error
189+
promise/no-callback-in-promise: error
190+
promise/no-multiple-resolved: error
191+
promise/no-native: off
192+
promise/no-nesting: error
193+
promise/no-new-statics: error
194+
promise/no-promise-in-callback: off
195+
promise/no-return-in-finally: error
196+
promise/no-return-wrap: error
197+
promise/param-names: off
198+
promise/prefer-await-to-callbacks: off
199+
promise/prefer-await-to-then: off
200+
promise/valid-params: error
201+
180202
##############################################################################
181203
# ESLint builtin rules list based on `v8.27.x`
182204
##############################################################################

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"eslint-plugin-import": "2.26.0",
7878
"eslint-plugin-internal-rules": "file:./resources/eslint-internal-rules",
7979
"eslint-plugin-node": "11.1.0",
80+
"eslint-plugin-promise": "^6.1.1",
8081
"eslint-plugin-react": "7.31.10",
8182
"eslint-plugin-react-hooks": "4.6.0",
8283
"eslint-plugin-simple-import-sort": "8.0.0",

0 commit comments

Comments
 (0)