fix(api): linting issues with fastify (#65278)

This commit is contained in:
Mrugesh Mohapatra
2026-01-19 13:53:35 +05:30
committed by GitHub
parent 3c5ef03e6f
commit f908382e94
6 changed files with 78 additions and 18 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import type { FastifyPluginCallback } from 'fastify';
import type { FastifyError, FastifyPluginCallback } from 'fastify';
import * as Sentry from '@sentry/node';
import fp from 'fastify-plugin';
@@ -22,7 +22,7 @@ const errorHandling: FastifyPluginCallback = (fastify, _options, done) => {
fastify.decorate('Sentry', Sentry);
fastify.setErrorHandler((error, request, reply) => {
fastify.setErrorHandler((error: FastifyError, request, reply) => {
const logger = fastify.log.child({ req: request });
const accepts = request.accepts().type(['json', 'html']);
const { returnTo } = getRedirectParams(request);
+2 -2
View File
@@ -1,5 +1,5 @@
import { type FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox';
import type { FastifyInstance } from 'fastify';
import type { FastifyError, FastifyInstance } from 'fastify';
import { differenceInMinutes } from 'date-fns';
import validator from 'validator';
@@ -134,7 +134,7 @@ export const settingRoutes: FastifyPluginCallbackTypebox = (
_options,
done
) => {
fastify.setErrorHandler((error, request, reply) => {
fastify.setErrorHandler((error: FastifyError, request, reply) => {
const logger = fastify.log.child({ req: request });
if (error.validation) {
logger.warn({ validationError: error.validation });
@@ -13,6 +13,10 @@ export const updateMyAbout = {
message: Type.Literal('flash.updated-about-me'),
type: Type.Literal('success')
}),
400: Type.Object({
message: Type.Literal('flash.wrong-updating'),
type: Type.Literal('danger')
}),
500: Type.Object({
message: Type.Literal('flash.wrong-updating'),
type: Type.Literal('danger')
+4
View File
@@ -14,6 +14,10 @@ export const reportUser = {
email: Type.String()
})
}),
403: Type.Object({
type: Type.Literal('danger'),
message: Type.Literal('flash.report-error')
}),
404: Type.Object({
type: Type.Literal('danger'),
message: Type.Literal('flash.report-error')