chore(root): migrate to biome

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-09-16 12:20:40 +02:00
parent 1f6e198336
commit 32e91959f6
383 changed files with 1943 additions and 3085 deletions

View File

@@ -14,7 +14,7 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
req: FastifyRequest<{
Body: PostEventPayload;
}>,
reply
reply,
) => {
try {
const client = await validateSdkRequest(req.headers).catch((error) => {
@@ -51,7 +51,7 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
reply.status(401).send();
return;
}
}
},
);
fastify.route({

View File

@@ -15,11 +15,14 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
error: 'Unauthorized',
message: 'Client ID seems to be malformed',
});
} else if (e instanceof Error) {
}
if (e instanceof Error) {
return reply
.status(401)
.send({ error: 'Unauthorized', message: e.message });
}
return reply
.status(401)
.send({ error: 'Unauthorized', message: 'Unexpected error' });

View File

@@ -15,11 +15,14 @@ const importRouter: FastifyPluginCallback = (fastify, opts, done) => {
error: 'Unauthorized',
message: 'Client ID seems to be malformed',
});
} else if (e instanceof Error) {
}
if (e instanceof Error) {
return reply
.status(401)
.send({ error: 'Unauthorized', message: e.message });
}
return reply
.status(401)
.send({ error: 'Unauthorized', message: 'Unexpected error' });

View File

@@ -20,12 +20,12 @@ const liveRouter: FastifyPluginCallback = (fastify, opts, done) => {
fastify.get(
'/visitors/:projectId',
{ websocket: true },
controller.wsVisitors
controller.wsVisitors,
);
fastify.get(
'/events/:projectId',
{ websocket: true },
controller.wsProjectEvents
controller.wsProjectEvents,
);
done();
});

View File

@@ -14,7 +14,7 @@ const trackRouter: FastifyPluginCallback = (fastify, opts, done) => {
req: FastifyRequest<{
Body: TrackHandlerPayload;
}>,
reply
reply,
) => {
try {
const client = await validateSdkRequest(req.headers).catch((error) => {
@@ -55,7 +55,7 @@ const trackRouter: FastifyPluginCallback = (fastify, opts, done) => {
reply.status(401).send();
return;
}
}
},
);
fastify.route({