Skip to content

Commit

Permalink
feat(eslint-config): enable "no-return-await" rule
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bajtos committed Jul 30, 2019
1 parent 279fdce commit e28a3c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/eslint-config/eslintrc.js
Expand Up @@ -56,6 +56,10 @@ module.exports = {
// TypeScript allows the same name for namespace and function
'no-redeclare': 'off',

// Avoid promise rewrapping
// https://exploringjs.com/es2016-es2017/ch_async-functions.html#_returned-promises-are-not-wrapped
'no-return-await': 'error',

/**
* Rules imported from eslint-config-loopback
*/
Expand Down

0 comments on commit e28a3c3

Please sign in to comment.