From 934eecd9c994b0d266861a0f2c312e4571e222d4 Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Mon, 3 Sep 2018 17:38:13 -0600 Subject: [PATCH] style: Prettier everything --- common/browserLogger.ts | 4 ++-- server/Database.ts | 4 ---- server/commands/manage.ts | 8 ++++---- server/commands/pretty.ts | 3 ++- server/express/errorHandler.ts | 5 ++++- server/state.ts | 4 +--- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/common/browserLogger.ts b/common/browserLogger.ts index efd5399..88723f5 100644 --- a/common/browserLogger.ts +++ b/common/browserLogger.ts @@ -119,8 +119,8 @@ function formatLevel(value: any): ColoredString { } const browserLogger = { - serialize: true, - write, + serialize: true, + write }; export default browserLogger; diff --git a/server/Database.ts b/server/Database.ts index 124682b..905de32 100644 --- a/server/Database.ts +++ b/server/Database.ts @@ -37,11 +37,7 @@ export class Database { } } - async createAll() { - } - async insertTestData() { - const NUM = 100; const users: User[] = []; for (let i = 0; i < NUM; i++) { diff --git a/server/commands/manage.ts b/server/commands/manage.ts index 9ab80ac..a98f627 100644 --- a/server/commands/manage.ts +++ b/server/commands/manage.ts @@ -5,7 +5,7 @@ import { createApp, ServerState, WebSocketApi } from "../"; import log from "@common/logger"; export default class ManageCommand extends Command { - run(): Promise { - throw new Error("Method not implemented."); - } -} \ No newline at end of file + run(): Promise { + throw new Error("Method not implemented."); + } +} diff --git a/server/commands/pretty.ts b/server/commands/pretty.ts index c3d5748..07c12d8 100644 --- a/server/commands/pretty.ts +++ b/server/commands/pretty.ts @@ -150,7 +150,8 @@ export class PinoPrettyTransform extends Transform { } export default class PrettyCommand extends Command { - static description = "Transforms sprinklers3 log output into a pretty, colorized format"; + static description = + "Transforms sprinklers3 log output into a pretty, colorized format"; async run(): Promise { pump(process.stdin, split(), new PinoPrettyTransform(), process.stdout); diff --git a/server/express/errorHandler.ts b/server/express/errorHandler.ts index 6f183ea..cadc244 100644 --- a/server/express/errorHandler.ts +++ b/server/express/errorHandler.ts @@ -15,7 +15,10 @@ const errorHandler: express.ErrorRequestHandler = ( // TODO: different content-type? res.status(err.statusCode).json(err.toJSON(isDev)); } else { - const internalError = new ApiError("An internal server error has occurred", ErrorCode.Internal); + const internalError = new ApiError( + "An internal server error has occurred", + ErrorCode.Internal + ); errorHandler(internalError, req, res, next); } }; diff --git a/server/state.ts b/server/state.ts index 9982dc7..ba0efdb 100644 --- a/server/state.ts +++ b/server/state.ts @@ -38,8 +38,6 @@ export class ServerState { } async start() { - await Promise.all([ - this.startDatabase(), this.startMqtt(), - ]); + await Promise.all([this.startDatabase(), this.startMqtt()]); } }