matrix-js-sdk
matrix-js-sdk copied to clipboard
Enable eslint rules: @typescript-eslint/await-thenable and @typescript-eslint/no-misused-promises
These rules help encourage correct handling of promises and make promise abuse more explicit.
Part of https://github.com/matrix-org/matrix-js-sdk/issues/2118
This change is marked as an internal change (Task), so will not be included in the changelog.
Codecov Report
Merging #2290 (93ed2f6) into develop (5937e6a) will increase coverage by
0.00%
. The diff coverage is57.57%
.
@@ Coverage Diff @@
## develop #2290 +/- ##
========================================
Coverage 59.56% 59.57%
========================================
Files 91 91
Lines 16416 16424 +8
Branches 3784 3784
========================================
+ Hits 9778 9784 +6
- Misses 6638 6640 +2
Impacted Files | Coverage Δ | |
---|---|---|
src/http-api.ts | 54.42% <0.00%> (ø) |
|
src/crypto/dehydration.ts | 11.81% <12.50%> (ø) |
|
src/webrtc/callEventHandler.ts | 8.45% <33.33%> (+0.64%) |
:arrow_up: |
src/models/relations.ts | 50.65% <66.66%> (-0.01%) |
:arrow_down: |
src/webrtc/call.ts | 36.14% <75.00%> (+0.03%) |
:arrow_up: |
src/crypto/CrossSigning.ts | 83.89% <100.00%> (ø) |
|
src/crypto/backup.ts | 63.38% <100.00%> (ø) |
|
src/crypto/index.ts | 64.38% <100.00%> (+0.05%) |
:arrow_up: |
src/models/thread.ts | 69.35% <100.00%> (+0.24%) |
:arrow_up: |
src/utils.ts | 88.23% <100.00%> (ø) |
In my absence last week I missed the web meetings, was applying this rule discussed with the team?
Not to my knowledge. Code style discussion lives at https://github.com/vector-im/element-meta/pull/216 where this rule (and the inverse of this rule) aren't mentioned.
This was a speculative PR on my part, so do please dismiss if you wish.
It is a step towards https://github.com/matrix-org/matrix-js-sdk/pull/2291 which I believe has higher value as it identifies some possible bug sites.
Cleaning up this stale PR. I would still advocate for the application of the @typescript-eslint/await-thenable
and @typescript-eslint/no-misused-promises
rules on this project.
@hughns I suggest bringing it up in a Web Weekly meeting where it can be voted upon