Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint: enable no-return-await #2707

Merged
merged 1 commit into from
Mar 5, 2019
Merged

Conversation

wbinnssmith
Copy link
Contributor

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. 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

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`
@wbinnssmith wbinnssmith changed the base branch from v2-work-so-far to master March 1, 2019 23:50
@devongovett devongovett merged commit c3921cb into master Mar 5, 2019
@devongovett devongovett deleted the wbinnssmith/lint-await branch March 5, 2019 04:00
wbinnssmith added a commit that referenced this pull request Mar 13, 2019
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`
wbinnssmith added a commit that referenced this pull request Mar 14, 2019
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`
wbinnssmith added a commit that referenced this pull request Mar 14, 2019
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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants