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
Update code to make it TS 4.4 compatible #1319
Conversation
Okay, now all the errors are settled. We'd like to merge this as early as possible to smoothly accept contributions. |
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.
comments for reviewers
@@ -39,7 +39,7 @@ | |||
}, | |||
"dependencies": { | |||
"@slack/logger": "^3.0.0", | |||
"@slack/web-api": "^6.0.0", | |||
"@slack/web-api": "^6.3.0", |
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.
This has not been safe enough. oauth.v2.access API argments in the code are compatible only with 6.3+
@@ -191,7 +191,7 @@ export class InstallProvider { | |||
} | |||
|
|||
return authResult; | |||
} catch (error) { | |||
} catch (error: any) { |
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.
As either any or unknown is allowed for the type, we are unable to use more specific types here. If we want to do so, we have to cast the type from unknown inside the catch clause.
this.logger.warn('http request failed', error.message); | ||
if (error.request) { | ||
throw requestErrorWithOriginal(error); | ||
// To make this compatible with tsd, casting here instead of `catch (error: any)` |
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.
We run tsd type tests only for web-api package as of today
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.
Thanks for bumping up compatibility to TS 4.4!
Thanks for the review! Let me merge this not to block the following contributions! If we find better ways to change the code, we can update at any time! |
Summary
This pull request fixes the compilation failures with the latest TypeScript compiler (v4.4.x)
Requirements (place an
x
in each[ ]
)