Skip to content

Commit e28a3c3

Browse files
committed
feat(eslint-config): enable "no-return-await" rule
See https://eslint.org/docs/rules/no-return-await: > Since the return value of an async function is always wrapped in > `Promise.resolve, `return await` doesn’t actually do anything except > add extra time before the overarching `Promise` resolves or rejects. BREAKING CHANGE: "return await" is no longer allowed, just return the promise without awaiting its resolution.
1 parent 279fdce commit e28a3c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/eslint-config/eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ module.exports = {
5656
// TypeScript allows the same name for namespace and function
5757
'no-redeclare': 'off',
5858

59+
// Avoid promise rewrapping
60+
// https://exploringjs.com/es2016-es2017/ch_async-functions.html#_returned-promises-are-not-wrapped
61+
'no-return-await': 'error',
62+
5963
/**
6064
* Rules imported from eslint-config-loopback
6165
*/

0 commit comments

Comments
 (0)