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] improve performance #1536

Merged
merged 3 commits into from Feb 2, 2020

Conversation

bradzacher
Copy link
Member

@bradzacher bradzacher commented Jan 29, 2020

Figured that we didn't need to:

  • check return statements in a function that isn't async.
  • check return statement if the function already has an as await.
  • check body-less arrow function value if it's an await expression.

This will saves many unneeded type checks across a codebase.

This has the unfortunate maintenance downside of bringing the entire codebase in, but the old extension did something unstable anyways, so I don't think it matters.

@bradzacher bradzacher added the bug Something isn't working label Jan 29, 2020
@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 Jan 29, 2020

Codecov Report

Merging #1536 into master will decrease coverage by 0.13%.
The diff coverage is 97.22%.

@@            Coverage Diff             @@
##           master    #1536      +/-   ##
==========================================
- Coverage   95.49%   95.36%   -0.14%     
==========================================
  Files         150      151       +1     
  Lines        6639     6711      +72     
  Branches     1880     1899      +19     
==========================================
+ Hits         6340     6400      +60     
- Misses        112      118       +6     
- Partials      187      193       +6
Impacted Files Coverage Δ
packages/eslint-plugin/src/rules/require-await.ts 97.82% <97.22%> (-2.18%) ⬇️
packages/eslint-plugin/src/util/types.ts 80.95% <0%> (-1.53%) ⬇️
packages/eslint-plugin/src/rules/index.ts 100% <0%> (ø) ⬆️
...rc/rules/no-unnecessary-boolean-literal-compare.ts 77.14% <0%> (ø)

@bradzacher bradzacher merged commit 45ae0b9 into master Feb 2, 2020
@bradzacher bradzacher deleted the improve-require-await-perf branch February 2, 2020 17:18
@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.

None yet

1 participant