You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a sync function returns a Promise, it could throw before the promise is returned. That forces complexity on the caller to handle both exceptions and rejected promises.
Take their rule and put it into an Agoric eslint plugin (#10665), adding new config options. It should be backwards compatible with typescript-eslint so we can propose adding the features upstream.
A new option like allowBlockless should not flag:
a block-less arrow function
which only contains expressions that cannot throw
calling a promise returning function is assumed to not throw
E(foo).bar is known to not throw
We might also need a safePromisNames option to express that EGetters can't throw.
If it's too difficult to generalize for typescript-eslint it could migrate to Endo instead.
Security Considerations
Scaling Considerations
Test Plan
Upgrade Considerations
The text was updated successfully, but these errors were encountered:
What is the Problem Being Solved?
When a sync function returns a Promise, it could throw before the promise is returned. That forces complexity on the caller to handle both exceptions and rejected promises.
Description of the Design
https://typescript-eslint.io/rules/promise-function-async/ is close but has some unnecessary ugliness,
Take their rule and put it into an Agoric eslint plugin (#10665), adding new config options. It should be backwards compatible with typescript-eslint so we can propose adding the features upstream.
A new option like
allowBlockless
should not flag:We might also need a
safePromisNames
option to express that EGetters can't throw.If it's too difficult to generalize for typescript-eslint it could migrate to Endo instead.
Security Considerations
Scaling Considerations
Test Plan
Upgrade Considerations
The text was updated successfully, but these errors were encountered: