Fix ESLint issues across codebase

- Replace 'any' types with proper TypeScript interfaces
- Fix unescaped apostrophe in not-found page
- Convert actionTypes constant to type definition to fix unused variable
- Optimize font loading using next/font instead of external links
- Improve type safety and remove linting warnings
This commit is contained in:
Derek Slenk 2025-06-29 17:55:13 -04:00
parent 9619cf2bf9
commit d03121001a
8 changed files with 2341 additions and 20 deletions

6
.eslintrc.json Normal file
View file

@ -0,0 +1,6 @@
{
"extends": [
"next/core-web-vitals",
"next/typescript"
]
}

2310
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -69,6 +69,8 @@
"aws-cdk-lib": "^2.189.1", "aws-cdk-lib": "^2.189.1",
"constructs": "^10.4.2", "constructs": "^10.4.2",
"esbuild": "^0.25.5", "esbuild": "^0.25.5",
"eslint": "9.30.0",
"eslint-config-next": "15.3.4",
"genkit-cli": "^1.13.0", "genkit-cli": "^1.13.0",
"postcss": "^8", "postcss": "^8",
"tailwindcss": "^3.4.1", "tailwindcss": "^3.4.1",

View file

@ -57,7 +57,14 @@ async function getYouTubeVideos(ids: string[]): Promise<Video[]> {
return fallbackData; return fallbackData;
} }
const fetchedVideos = data.items.map((item: any) => ({ interface YouTubeVideoItem {
id: string;
snippet: {
title: string;
};
}
const fetchedVideos = data.items.map((item: YouTubeVideoItem) => ({
id: item.id, id: item.id,
title: item.snippet.title, title: item.snippet.title,
})); }));

View file

@ -56,7 +56,14 @@ async function getYouTubeVideos(ids: string[]): Promise<Video[]> {
return fallbackData; return fallbackData;
} }
const fetchedVideos = data.items.map((item: any) => ({ interface YouTubeVideoItem {
id: string;
snippet: {
title: string;
};
}
const fetchedVideos = data.items.map((item: YouTubeVideoItem) => ({
id: item.id, id: item.id,
title: item.snippet.title, title: item.snippet.title,
})); }));

View file

@ -1,8 +1,11 @@
import type { Metadata } from 'next'; import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import './globals.css'; import './globals.css';
import { Toaster } from '@/components/ui/toaster'; import { Toaster } from '@/components/ui/toaster';
import { ThemeProvider } from '@/components/theme-provider'; import { ThemeProvider } from '@/components/theme-provider';
const inter = Inter({ subsets: ['latin'] });
export const metadata: Metadata = { export const metadata: Metadata = {
title: 'Cheating Chelsea Exposed - The Truth About Chelsea Smallwood', title: 'Cheating Chelsea Exposed - The Truth About Chelsea Smallwood',
description: description:
@ -61,19 +64,7 @@ export default function RootLayout({
}>) { }>) {
return ( return (
<html lang="en" suppressHydrationWarning> <html lang="en" suppressHydrationWarning>
<head> <body className={`${inter.className} font-body antialiased`}>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin=""
/>
<link
href="https://fonts.googleapis.com/css2?family=Inter&display=swap"
rel="stylesheet"
/>
</head>
<body className="font-body antialiased">
<ThemeProvider <ThemeProvider
attribute="class" attribute="class"
defaultTheme="system" defaultTheme="system"

View file

@ -17,7 +17,7 @@ export default function NotFound() {
/> />
</div> </div>
<p className="text-muted-foreground mt-8 mb-8 text-xl"> <p className="text-muted-foreground mt-8 mb-8 text-xl">
Oops! It looks like the page you're looking for has gone into hiding. Oops! It looks like the page you&apos;re looking for has gone into hiding.
</p> </p>
<Button asChild size="lg"> <Button asChild size="lg">
<Link href="/">Go Back to Home</Link> <Link href="/">Go Back to Home</Link>

View file

@ -18,12 +18,12 @@ type ToasterToast = ToastProps & {
action?: ToastActionElement action?: ToastActionElement
} }
const actionTypes = { type ActionType = {
ADD_TOAST: "ADD_TOAST", ADD_TOAST: "ADD_TOAST",
UPDATE_TOAST: "UPDATE_TOAST", UPDATE_TOAST: "UPDATE_TOAST",
DISMISS_TOAST: "DISMISS_TOAST", DISMISS_TOAST: "DISMISS_TOAST",
REMOVE_TOAST: "REMOVE_TOAST", REMOVE_TOAST: "REMOVE_TOAST",
} as const }
let count = 0 let count = 0
@ -32,8 +32,6 @@ function genId() {
return count.toString() return count.toString()
} }
type ActionType = typeof actionTypes
type Action = type Action =
| { | {
type: ActionType["ADD_TOAST"] type: ActionType["ADD_TOAST"]