style: Prettier everything

This commit is contained in:
Alex Mikhalev 2018-09-03 17:38:13 -06:00
parent 46f4b9d14a
commit 934eecd9c9
6 changed files with 13 additions and 15 deletions

View File

@ -119,8 +119,8 @@ function formatLevel(value: any): ColoredString {
} }
const browserLogger = { const browserLogger = {
serialize: true, serialize: true,
write, write
}; };
export default browserLogger; export default browserLogger;

View File

@ -37,11 +37,7 @@ export class Database {
} }
} }
async createAll() {
}
async insertTestData() { async insertTestData() {
const NUM = 100; const NUM = 100;
const users: User[] = []; const users: User[] = [];
for (let i = 0; i < NUM; i++) { for (let i = 0; i < NUM; i++) {

View File

@ -5,7 +5,7 @@ import { createApp, ServerState, WebSocketApi } from "../";
import log from "@common/logger"; import log from "@common/logger";
export default class ManageCommand extends Command { export default class ManageCommand extends Command {
run(): Promise<any> { run(): Promise<any> {
throw new Error("Method not implemented."); throw new Error("Method not implemented.");
} }
} }

View File

@ -150,7 +150,8 @@ export class PinoPrettyTransform extends Transform {
} }
export default class PrettyCommand extends Command { 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<any> { async run(): Promise<any> {
pump(process.stdin, split(), new PinoPrettyTransform(), process.stdout); pump(process.stdin, split(), new PinoPrettyTransform(), process.stdout);

View File

@ -15,7 +15,10 @@ const errorHandler: express.ErrorRequestHandler = (
// TODO: different content-type? // TODO: different content-type?
res.status(err.statusCode).json(err.toJSON(isDev)); res.status(err.statusCode).json(err.toJSON(isDev));
} else { } 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); errorHandler(internalError, req, res, next);
} }
}; };

View File

@ -38,8 +38,6 @@ export class ServerState {
} }
async start() { async start() {
await Promise.all([ await Promise.all([this.startDatabase(), this.startMqtt()]);
this.startDatabase(), this.startMqtt(),
]);
} }
} }