Fix ESLint errors

This commit is contained in:
gpt-engineer-app[bot]
2025-10-29 23:27:37 +00:00
parent 017879ba21
commit 41f4e3b920
16 changed files with 80 additions and 184 deletions

View File

@@ -5,12 +5,12 @@ import { join } from 'path';
type VercelRequest = IncomingMessage & {
query: { [key: string]: string | string[] };
cookies: { [key: string]: string };
body: any;
body: unknown;
};
type VercelResponse = ServerResponse & {
status: (code: number) => VercelResponse;
json: (data: any) => VercelResponse;
json: (data: unknown) => VercelResponse;
send: (body: string) => VercelResponse;
};
@@ -66,7 +66,7 @@ async function getPageData(pathname: string, fullUrl: string): Promise<PageData>
}
// Individual ride page: /parks/{park-slug}/rides/{ride-slug}
if (normalizedPath.match(/^\/parks\/[^\/]+\/rides\/[^\/]+$/)) {
if (normalizedPath.match(/^\/parks\/[^/]+\/rides\/[^/]+$/)) {
const parts = normalizedPath.split('/');
const rideSlug = parts[4];
@@ -178,7 +178,7 @@ function injectOGTags(html: string, ogTags: string): string {
return html;
}
export default async function handler(req: VercelRequest, res: VercelResponse) {
export default async function handler(req: VercelRequest, res: VercelResponse): Promise<void> {
try {
const userAgent = req.headers['user-agent'] || '';
const fullUrl = `https://${req.headers.host}${req.url}`;
@@ -239,7 +239,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
const html = readFileSync(htmlPath, 'utf-8');
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.status(200).send(html);
} catch (fallbackError) {
} catch {
res.status(500).send('Internal Server Error');
}
}