-
Notifications
You must be signed in to change notification settings - Fork 149
Open
Labels
Description
Is your feature request related to a problem? Please describe.
After our TS refactors, a few places have any for wildcard types and as for casting, which we want to remove for a truly clean TS refactor.
One of the quintessential examples of this is on try-catch blocks (source: checkHiddenCommits.ts):
try {
//...
} catch (e: any) {
step.setError(e.message);
throw e;
} finally {
action.addStep(step);
}We can replace the catch bit with the following:
catch (e: unknown) {
if (e instanceof Error) {
step.setError(e.message);
}
throw e;
}Describe the solution you'd like
Replace all (or as many as possible) usages of any and as with properly-typed equivalents.
Additional context
Requested by @06kellyjac in #1166 (comment).
06kellyjac