Skip to content
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

Add skip comments for any type warnings in socket-mode module #1458

Merged
merged 1 commit into from Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/socket-mode/src/SocketModeClient.ts
Expand Up @@ -543,6 +543,7 @@ export class SocketModeClient extends EventEmitter {
let event: {
type: string;
reason: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
payload: { [key: string]: any };
envelope_id: string;
retry_attempt?: number; // type: events_api
Expand All @@ -552,6 +553,7 @@ export class SocketModeClient extends EventEmitter {

try {
event = JSON.parse(data);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (parseError: any) {
// prevent application from crashing on a bad message, but log an error to bring attention
this.logger.error(
Expand Down
6 changes: 5 additions & 1 deletion packages/socket-mode/src/errors.ts
Expand Up @@ -22,6 +22,7 @@ export type SMCallError = SMPlatformError | SMWebsocketError | SMNoReplyReceived

export interface SMPlatformError extends CodedError {
code: ErrorCode.SendMessagePlatformError;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
data: any;
}

Expand Down Expand Up @@ -67,7 +68,10 @@ export function websocketErrorWithOriginal(original: Error): SMWebsocketError {
/**
* A factory to create SMPlatformError objects.
*/
export function platformErrorFromEvent(event: any & { error: { msg: string; } }): SMPlatformError {
export function platformErrorFromEvent(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
event: any & { error: { msg: string; } },
): SMPlatformError {
const error = errorWithCode(
new Error(`An API error occurred: ${event.error.msg}`),
ErrorCode.SendMessagePlatformError,
Expand Down