fix: linting
Some checks failed
Build & Deploy / 🔍 Prepare Environment (push) Successful in 5s
Build & Deploy / 🧪 QA (push) Failing after 1m14s
Build & Deploy / 🏗️ Build (push) Failing after 4m44s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🔔 Notifications (push) Successful in 1s

This commit is contained in:
2026-02-07 01:25:15 +01:00
parent 6f5c9bd613
commit d0d66dd85f
9 changed files with 43 additions and 31 deletions

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type {
AnalyticsEventProperties,
AnalyticsService,

View File

@@ -39,7 +39,8 @@ export class UmamiAnalyticsService implements AnalyticsService {
/**
* Internal method to send the payload to Umami API.
*/
private async sendPayload(type: "event", data: Record<string, any>) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private async sendPayload(type: "event", data: Record<string, unknown>) {
if (!this.options.enabled || !this.websiteId) return;
try {
@@ -65,8 +66,8 @@ export class UmamiAnalyticsService implements AnalyticsService {
typeof window === "undefined" ? "KLZ-Server" : navigator.userAgent,
},
body: JSON.stringify({ type, payload }),
// Use keepalive for page navigation events to ensure they complete
keepalive: true,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any);
if (!response.ok && process.env.NODE_ENV === "development") {

View File

@@ -105,9 +105,9 @@ export function getAppServices(): AppServices {
// Use dynamic import to avoid importing server-only code in client components
const analytics = umamiEnabled
? (() => {
const {
UmamiAnalyticsService,
} = require("./analytics/umami-analytics-service");
const { UmamiAnalyticsService } =
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./analytics/umami-analytics-service");
return new UmamiAnalyticsService({ enabled: true });
})()
: new NoopAnalyticsService();

View File

@@ -22,6 +22,7 @@ export class GlitchtipErrorReportingService implements ErrorReportingService {
async captureException(error: unknown, context?: Record<string, unknown>) {
if (!this.options.enabled) return undefined;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const result = this.sentry.captureException(error, context as any) as any;
// Send to Gotify if it's considered critical or if we just want all exceptions there
@@ -46,11 +47,13 @@ export class GlitchtipErrorReportingService implements ErrorReportingService {
captureMessage(message: string, level: ErrorReportingLevel = "error") {
if (!this.options.enabled) return undefined;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return this.sentry.captureMessage(message, level as any) as any;
}
setUser(user: ErrorReportingUser | null) {
if (!this.options.enabled) return;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.sentry.setUser(user as any);
}

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type {
ErrorReportingLevel,
ErrorReportingService,

View File

@@ -1,11 +1,11 @@
export type LogLevel = "trace" | "debug" | "info" | "warn" | "error" | "fatal";
export interface LoggerService {
trace(msg: string, ...args: any[]): void;
debug(msg: string, ...args: any[]): void;
info(msg: string, ...args: any[]): void;
warn(msg: string, ...args: any[]): void;
error(msg: string, ...args: any[]): void;
fatal(msg: string, ...args: any[]): void;
child(bindings: Record<string, any>): LoggerService;
trace(msg: string, ...args: unknown[]): void;
debug(msg: string, ...args: unknown[]): void;
info(msg: string, ...args: unknown[]): void;
warn(msg: string, ...args: unknown[]): void;
error(msg: string, ...args: unknown[]): void;
fatal(msg: string, ...args: unknown[]): void;
child(bindings: Record<string, unknown>): LoggerService;
}

View File

@@ -30,35 +30,41 @@ export class PinoLoggerService implements LoggerService {
}
}
trace(msg: string, ...args: any[]) {
this.logger.trace(msg, ...args);
trace(msg: string, ...args: unknown[]) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.logger.trace(msg, ...(args as any));
}
debug(msg: string, ...args: any[]) {
this.logger.debug(msg, ...args);
debug(msg: string, ...args: unknown[]) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.logger.debug(msg, ...(args as any));
}
info(msg: string, ...args: any[]) {
this.logger.info(msg, ...args);
info(msg: string, ...args: unknown[]) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.logger.info(msg, ...(args as any));
}
warn(msg: string, ...args: any[]) {
this.logger.warn(msg, ...args);
warn(msg: string, ...args: unknown[]) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.logger.warn(msg, ...(args as any));
}
error(msg: string, ...args: any[]) {
this.logger.error(msg, ...args);
error(msg: string, ...args: unknown[]) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.logger.error(msg, ...(args as any));
}
fatal(msg: string, ...args: any[]) {
this.logger.fatal(msg, ...args);
fatal(msg: string, ...args: unknown[]) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.logger.fatal(msg, ...(args as any));
}
child(bindings: Record<string, any>): LoggerService {
child(bindings: Record<string, unknown>): LoggerService {
const childPino = this.logger.child(bindings);
const service = new PinoLoggerService();
// @ts-expect-error - accessing private member for child creation
service.logger = childPino;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(service as any).logger = childPino;
return service;
}
}

View File

@@ -46,7 +46,8 @@ export class GotifyNotificationService implements NotificationService {
}
export class NoopNotificationService implements NotificationService {
async notify(): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async notify(_options: NotificationOptions): Promise<void> {
// Do nothing
}
}