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

@@ -5,7 +5,6 @@ import "../globals.css";
import { NextIntlClientProvider } from "next-intl"; import { NextIntlClientProvider } from "next-intl";
import { getMessages } from "next-intl/server"; import { getMessages } from "next-intl/server";
import { notFound } from "next/navigation"; import { notFound } from "next/navigation";
import { config } from "@/lib/config";
const inter = Inter({ const inter = Inter({
subsets: ["latin"], subsets: ["latin"],
@@ -71,9 +70,9 @@ export default async function RootLayout({
params, params,
}: { }: {
children: React.ReactNode; children: React.ReactNode;
params: Promise<{ locale: string }>; params: { locale: string };
}) { }) {
const { locale } = await params; const { locale } = params;
// Validate that the incoming `locale` is supported // Validate that the incoming `locale` is supported
if (locale !== "de") { if (locale !== "de") {

View File

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

View File

@@ -39,7 +39,8 @@ export class UmamiAnalyticsService implements AnalyticsService {
/** /**
* Internal method to send the payload to Umami API. * 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; if (!this.options.enabled || !this.websiteId) return;
try { try {
@@ -65,8 +66,8 @@ export class UmamiAnalyticsService implements AnalyticsService {
typeof window === "undefined" ? "KLZ-Server" : navigator.userAgent, typeof window === "undefined" ? "KLZ-Server" : navigator.userAgent,
}, },
body: JSON.stringify({ type, payload }), body: JSON.stringify({ type, payload }),
// Use keepalive for page navigation events to ensure they complete
keepalive: true, keepalive: true,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any); } as any);
if (!response.ok && process.env.NODE_ENV === "development") { 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 // Use dynamic import to avoid importing server-only code in client components
const analytics = umamiEnabled const analytics = umamiEnabled
? (() => { ? (() => {
const { const { UmamiAnalyticsService } =
UmamiAnalyticsService, // eslint-disable-next-line @typescript-eslint/no-require-imports
} = require("./analytics/umami-analytics-service"); require("./analytics/umami-analytics-service");
return new UmamiAnalyticsService({ enabled: true }); return new UmamiAnalyticsService({ enabled: true });
})() })()
: new NoopAnalyticsService(); : new NoopAnalyticsService();

View File

@@ -22,6 +22,7 @@ export class GlitchtipErrorReportingService implements ErrorReportingService {
async captureException(error: unknown, context?: Record<string, unknown>) { async captureException(error: unknown, context?: Record<string, unknown>) {
if (!this.options.enabled) return undefined; 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; 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 // 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") { captureMessage(message: string, level: ErrorReportingLevel = "error") {
if (!this.options.enabled) return undefined; 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; return this.sentry.captureMessage(message, level as any) as any;
} }
setUser(user: ErrorReportingUser | null) { setUser(user: ErrorReportingUser | null) {
if (!this.options.enabled) return; if (!this.options.enabled) return;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.sentry.setUser(user as any); this.sentry.setUser(user as any);
} }

View File

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

View File

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

View File

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

View File

@@ -46,7 +46,8 @@ export class GotifyNotificationService implements NotificationService {
} }
export class NoopNotificationService 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 // Do nothing
} }
} }