diff --git a/.eslintrc.yml b/.eslintrc.yml index df164d25..83c8856b 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -100,7 +100,6 @@ rules: '@typescript-eslint/no-unnecessary-condition': - error - allowConstantLoopConditions: true - '@typescript-eslint/no-untyped-public-signature': off # bugs out on constructors '@typescript-eslint/restrict-template-expressions': off '@typescript-eslint/prefer-readonly-parameter-types': off '@typescript-eslint/no-unsafe-member-access': off diff --git a/terminus-ssh/src/api.ts b/terminus-ssh/src/api.ts index f028cd4b..e6583950 100644 --- a/terminus-ssh/src/api.ts +++ b/terminus-ssh/src/api.ts @@ -212,7 +212,8 @@ export class SSHSession extends BaseSession { } const socket = new Socket() socket.connect(forward.targetPort, forward.targetAddress) - socket.on('error', (e: Error) => { + socket.on('error', e => { + // eslint-disable-next-line @typescript-eslint/no-base-to-string this.emitServiceMessage(colors.bgRed.black(' X ') + ` Could not forward the remote connection to ${forward.targetAddress}:${forward.targetPort}: ${e}`) reject() }) @@ -242,7 +243,8 @@ export class SSHSession extends BaseSession { if (!displaySpec.startsWith('/')) { socket.connect(xPort, xHost) } - socket.on('error', (e: Error) => { + socket.on('error', e => { + // eslint-disable-next-line @typescript-eslint/no-base-to-string this.emitServiceMessage(colors.bgRed.black(' X ') + ` Could not connect to the X server ${xHost}:${xPort}: ${e}`) reject() }) @@ -277,8 +279,9 @@ export class SSHSession extends BaseSession { sourcePort ?? 0, targetAddress, targetPort, - (err: Error, stream) => { + (err, stream) => { if (err) { + // eslint-disable-next-line @typescript-eslint/no-base-to-string this.emitServiceMessage(colors.bgRed.black(' X ') + ` Remote has rejected the forwarded connection to ${targetAddress}:${targetPort} via ${fw}: ${err}`) return reject() } @@ -303,8 +306,9 @@ export class SSHSession extends BaseSession { } if (fw.type === PortForwardType.Remote) { await new Promise((resolve, reject) => { - this.ssh.forwardIn(fw.host, fw.port, (err: Error) => { + this.ssh.forwardIn(fw.host, fw.port, err => { if (err) { + // eslint-disable-next-line @typescript-eslint/no-base-to-string this.emitServiceMessage(colors.bgRed.black(' X ') + ` Remote rejected port forwarding for ${fw}: ${err}`) return reject(err) } diff --git a/terminus-ssh/src/services/ssh.service.ts b/terminus-ssh/src/services/ssh.service.ts index 2140988a..c4ae4c9c 100644 --- a/terminus-ssh/src/services/ssh.service.ts +++ b/terminus-ssh/src/services/ssh.service.ts @@ -155,12 +155,13 @@ export class SSHService { } this.zone.run(resolve) }) - ssh.on('error', (error: Error) => { + ssh.on('error', error => { if (error.message === 'All configured authentication methods failed') { this.passwordStorage.deletePassword(session.connection) } this.zone.run(() => { if (connected) { + // eslint-disable-next-line @typescript-eslint/no-base-to-string this.toastr.error(error.toString()) } else { reject(error)