Browse Source

style: Prettier everything

update-deps
Alex Mikhalev 6 years ago
parent
commit
934eecd9c9
  1. 2
      common/browserLogger.ts
  2. 4
      server/Database.ts
  3. 3
      server/commands/pretty.ts
  4. 5
      server/express/errorHandler.ts
  5. 4
      server/state.ts

2
common/browserLogger.ts

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

4
server/Database.ts

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

3
server/commands/pretty.ts

@ -150,7 +150,8 @@ export class PinoPrettyTransform extends Transform { @@ -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<any> {
pump(process.stdin, split(), new PinoPrettyTransform(), process.stdout);

5
server/express/errorHandler.ts

@ -15,7 +15,10 @@ const errorHandler: express.ErrorRequestHandler = ( @@ -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);
}
};

4
server/state.ts

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

Loading…
Cancel
Save