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

fix(eslint-plugin): [require-await] better handle nesting #1193

Merged
merged 4 commits into from Nov 16, 2019

Conversation

bradzacher
Copy link
Member

@bradzacher bradzacher commented Nov 11, 2019

Fixes #1188

The extension knows the inner callback doesn't need have an error, so it doesn't call the base rule's handler. But in doing so, it means the base rule doesn't properly update its internal state, so it ends up looking at the state for the cb whilst exiting testFunction.

This fixes the rule so that instead of not calling the base rule, it uses the rule's logic to update the rule's internal state, which prevents the base rule logic from erroring.

@bradzacher bradzacher added the bug Something isn't working label Nov 11, 2019
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@codecov
Copy link

codecov bot commented Nov 16, 2019

Codecov Report

Merging #1193 into master will increase coverage by 0.03%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1193      +/-   ##
==========================================
+ Coverage   94.13%   94.17%   +0.03%     
==========================================
  Files         124      124              
  Lines        5340     5318      -22     
  Branches     1494     1490       -4     
==========================================
- Hits         5027     5008      -19     
+ Misses        178      177       -1     
+ Partials      135      133       -2
Impacted Files Coverage Δ
packages/eslint-plugin/src/rules/require-await.ts 100% <100%> (+7.31%) ⬆️

@bradzacher bradzacher merged commit eb83af1 into master Nov 16, 2019
@bradzacher bradzacher deleted the 1188-require-await-nested-cb branch November 16, 2019 01:36
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[require-await] require-await false positive
1 participant