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

Add ESLint rule for no floating promises #2292

Merged
merged 4 commits into from
May 22, 2023

Conversation

t1m0thyj
Copy link
Member

@t1m0thyj t1m0thyj commented May 17, 2023

Proposed changes

Resolves #2291 by adding a customized version of the @typescript-eslint/no-floating-promises rule that allows floating Thenables without a .catch method.

Release Notes

Milestone: 2.8.1

Changelog:

  • Added no-floating-promises rule that ignores floating thenables without a .catch method.
  • Updated linter rules and addressed linter errors.

Types of changes

What types of changes does your code introduce to Zowe Explorer?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Updates to Documentation or Tests (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the reviewer

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • PR title follows Conventional Commits Guidelines
  • PR Description is included
  • gif or screenshot is included if visual changes are made
  • yarn workspace vscode-extension-for-zowe vscode:prepublish has been executed
  • All checks have passed (DCO, Jenkins and Code Coverage)
  • I have added unit test and it is passing
  • I have added integration test and it is passing
  • There is coverage for the code that I have added
  • I have tested it manually and there are no regressions found
  • I have added necessary documentation (if appropriate)
  • Any PR dependencies have been merged and published (if appropriate)

Further comments

@t1m0thyj t1m0thyj added the no-changelog Add to PR's that don't require a CHANGELOG update label May 17, 2023
@JillieBeanSim JillieBeanSim added this to the v2.8.1 milestone May 18, 2023
t1m0thyj added 4 commits May 19, 2023 11:41
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj force-pushed the dev/eslint-floating-promise-rule branch from b2e0502 to af04f1c Compare May 19, 2023 15:55
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@t1m0thyj t1m0thyj changed the base branch from main to maintenance May 19, 2023 15:56
@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Patch coverage: 90.16% and no project coverage change.

Comparison is base (3760d55) 91.60% compared to head (af04f1c) 91.60%.

Additional details and impacted files
@@             Coverage Diff              @@
##           maintenance    #2292   +/-   ##
============================================
  Coverage        91.60%   91.60%           
============================================
  Files               90       90           
  Lines             9020     9021    +1     
  Branches          1853     1853           
============================================
+ Hits              8263     8264    +1     
  Misses             756      756           
  Partials             1        1           
Impacted Files Coverage Δ
packages/zowe-explorer/src/uss/ZoweUSSNode.ts 93.99% <0.00%> (ø)
packages/zowe-explorer/src/uss/actions.ts 90.83% <0.00%> (ø)
packages/zowe-explorer/src/Profiles.ts 82.35% <50.00%> (ø)
...ges/zowe-explorer/src/abstract/ZoweTreeProvider.ts 81.01% <50.00%> (ø)
packages/zowe-explorer/src/shared/actions.ts 87.16% <50.00%> (ø)
packages/zowe-explorer/src/shared/init.ts 97.91% <75.00%> (ø)
packages/zowe-explorer/src/PersistentFilters.ts 100.00% <100.00%> (ø)
packages/zowe-explorer/src/SpoolProvider.ts 93.75% <100.00%> (+0.09%) ⬆️
packages/zowe-explorer/src/ZoweExplorerExtender.ts 86.36% <100.00%> (ø)
packages/zowe-explorer/src/dataset/DatasetTree.ts 88.64% <100.00%> (ø)
... and 9 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@t1m0thyj t1m0thyj removed the no-changelog Add to PR's that don't require a CHANGELOG update label May 19, 2023
@t1m0thyj t1m0thyj marked this pull request as ready for review May 19, 2023 15:58
Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks @t1m0thyj for the fix

Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this rule @t1m0thyj! This is a great use case for rewire 😁

@zFernand0 zFernand0 merged commit 627881b into maintenance May 22, 2023
@zFernand0 zFernand0 deleted the dev/eslint-floating-promise-rule branch May 22, 2023 14:06
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.

Detect floating promises with ESLint
4 participants