-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eslint: enable no-return-await (#2707)
This sets violations of the `no-return-await` to `error`. `return await` is redundant as values returned from an async function are effectively wrapped in a `Promise.resolve`, and awaiting another promise in addition to this will defer resolution another microtick. [eslint is good enough to detect the valid use case of `return await` in a `try`/`catch`](https://eslint.org/docs/rules/no-return-await). We also get clever with a short circuiting `||` in `Resolver` so I disabled it there, but we should probably rewrite it to be clearer in the future. Test Plan: `yarn && yarn lint && yarn test`
- Loading branch information
1 parent
37e22d3
commit c3921cb
Showing
4 changed files
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,8 @@ | |
"globals": { | ||
"parcelRequire": true, | ||
"define": true | ||
}, | ||
"rules": { | ||
"no-return-await": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters