Fix API lint errors blocking CI
eslint has been failing on 11 no-explicit-any errors, which kept the whole pipeline red — including the new publish job that waits on lint. The casts all worked around missing types rather than unknown shapes: - jwt: @fastify/jwt decorates the instance at runtime, so the namespace is not in FastifyInstance's type. Described the parts we call and cast through unknown once, in one place, instead of `as any` at five sites. - permissions: FastifyInstance.db is declared by the db plugin; the cast was stale and hid the real type. - paginate: the querystring schema already validates page/perPage, so the call sites now name that shape via PaginationQuery. Also dropped an unused import and an unused binding whose call is kept for its validation side effect. No behaviour change: eslint and tsc are both clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { Server as SocketIOServer } from 'socket.io';
|
||||
import { nodes, organizationMembers, servers } from '@source/database';
|
||||
import { ROLES } from '@source/shared';
|
||||
import type { Role } from '@source/shared';
|
||||
import { getJwt } from '../lib/jwt.js';
|
||||
import type { AccessTokenPayload } from '../lib/jwt.js';
|
||||
import {
|
||||
daemonOpenConsoleStream,
|
||||
@@ -67,7 +68,7 @@ export default fp(async (app: FastifyInstance) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const verifier = (app as any).jwt?.verify;
|
||||
const verifier = getJwt(app)?.verify;
|
||||
if (typeof verifier !== 'function') {
|
||||
next(new Error('Authentication is not configured'));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user