-
Notifications
You must be signed in to change notification settings - Fork 819
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
chore: no-floating-promises #1780
chore: no-floating-promises #1780
Conversation
You'll want to ignore white spaces when reviewing this one. |
3eb6ef5
to
0acecb3
Compare
packages/opentelemetry-exporter-prometheus/src/PrometheusExporter.ts
Outdated
Show resolved
Hide resolved
0acecb3
to
a4f47c4
Compare
I guess in many cases it would be enough to add |
Yeah good point, the only reason was my preference for async/await syntax but this does make the review process more cumbersome, I will revert those if that is preferred. |
d0bc121
to
3a45f3c
Compare
I've made the rule warn in the test files where there are many floating promises, we can address these incrementally one (or more) test file(s) at a time in subsequent PRs. |
Codecov Report
@@ Coverage Diff @@
## main #1780 +/- ##
==========================================
- Coverage 92.75% 92.73% -0.02%
==========================================
Files 138 138
Lines 4927 4928 +1
Branches 1017 1017
==========================================
Hits 4570 4570
- Misses 357 358 +1
|
3a45f3c
to
fc87859
Compare
It is worth noting that the async/await syntax severely bloats the output size of the js. This is ok on the node side, but for the core modules and web modules it is something we need to consider. |
instead of |
fc87859
to
87dad56
Compare
I should probably know this but what is our global error handler? |
I guess the bloat comes from the transpilation step, right? |
87dad56
to
26fc571
Compare
There are 2 ways to handle errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me pending the breaking lint step
Only warn in tests, disable rule for existing occurences in non-test modules. Signed-off-by: naseemkullah <naseem@transit.app>
26fc571
to
b373c9a
Compare
Signed-off-by: naseemkullah <naseem@transit.app>
Ok, this is ready to go now. As mentioned we will tackle tests separately (the rule only emits a warning for tests until they are taken care of at which point we can enforce it). |
d3306d6
to
0d92152
Compare
Signed-off-by: naseemkullah <naseem@transit.app>
0d92152
to
a9eb7ca
Compare
Signed-off-by: Naseem naseem@transit.app
Which problem is this PR solving?
Short description of the changes
It was mostly tests that had floating promises (if there's been any test flakiness it could possibly be attributed to that), but there were a few floating promises in non-test code.