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
Currently the promise .catch argument is typed as any.
Allow setting this as unknown for greater type safety via the "useUnknownInCatchVariables" flag.
somePromise.catch(e => {
// e: any
});
🔍 Search Terms
.catch any
Promise any unknown
✅ Viability Checklist
My suggestion meets these guidelines:
[ x ] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[ x ] This wouldn't change the runtime behavior of existing JavaScript code
[ x ] This could be implemented without emitting different JS based on the types of the expressions
[ x ] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
Suggestion
Currently the promise .catch argument is typed as any.
Allow setting this as unknown for greater type safety via the "useUnknownInCatchVariables" flag.
🔍 Search Terms
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
📃 Motivating Example
Related ticket: #6283
💻 Use Cases
Any promise based code using
.catch
is potentially unsafe using any.The text was updated successfully, but these errors were encountered: