From 3bff243dcb4450d237fd55a88c1a1ed43afdaa44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Thu, 5 Nov 2020 17:20:37 +0100 Subject: [PATCH] fix lint. --- src/internal/websocket.ts | 6 +++--- src/utils/logger.ts | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/internal/websocket.ts b/src/internal/websocket.ts index be0fd98b..51e439f4 100644 --- a/src/internal/websocket.ts +++ b/src/internal/websocket.ts @@ -16,7 +16,7 @@ export class NekoWebSocket extends EventEmitter { constructor() { super() - + this._log = new Logger('websocket') } @@ -61,7 +61,7 @@ export class NekoWebSocket extends EventEmitter { this._log.warn(`attempting to send message while disconnected`) return } - + this._log.debug(`sending event '${event}' ${payload ? `with payload: ` : ''}`, payload) this._ws!.send(JSON.stringify({ event, ...payload })) } @@ -105,7 +105,7 @@ export class NekoWebSocket extends EventEmitter { private onDisconnected(reason?: Error) { this._log.debug(`disconnected:`, reason) - + this.disconnect() this.emit('disconnected', reason) } diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 8c9cfb79..f189eabc 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -2,24 +2,24 @@ export class Logger { private _scope: string = 'main' constructor(scope?: string) { - if(scope) { + if (scope) { this._scope = scope } } public error(error: Error) { - console.error('[%cNEKO%c] ['+this._scope+'] %cERR', 'color: #498ad8;', '', 'color: #d84949;', error) + console.error('[%cNEKO%c] [' + this._scope + '] %cERR', 'color: #498ad8;', '', 'color: #d84949;', error) } public warn(...log: any[]) { - console.warn('[%cNEKO%c] ['+this._scope+'] %cWRN', 'color: #498ad8;', '', 'color: #eae364;', ...log) + console.warn('[%cNEKO%c] [' + this._scope + '] %cWRN', 'color: #498ad8;', '', 'color: #eae364;', ...log) } public info(...log: any[]) { - console.info('[%cNEKO%c] ['+this._scope+'] %cINF', 'color: #498ad8;', '', 'color: #4ac94c;', ...log) + console.info('[%cNEKO%c] [' + this._scope + '] %cINF', 'color: #498ad8;', '', 'color: #4ac94c;', ...log) } public debug(...log: any[]) { - console.log('[%cNEKO%c] ['+this._scope+'] %cDBG', 'color: #498ad8;', '', 'color: #eae364;', ...log) + console.log('[%cNEKO%c] [' + this._scope + '] %cDBG', 'color: #498ad8;', '', 'color: #eae364;', ...log) } }