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:
parent
9619cf2bf9
commit
d03121001a
8 changed files with 2341 additions and 20 deletions
6
.eslintrc.json
Normal file
6
.eslintrc.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"extends": [
|
||||
"next/core-web-vitals",
|
||||
"next/typescript"
|
||||
]
|
||||
}
|
2310
package-lock.json
generated
2310
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -69,6 +69,8 @@
|
|||
"aws-cdk-lib": "^2.189.1",
|
||||
"constructs": "^10.4.2",
|
||||
"esbuild": "^0.25.5",
|
||||
"eslint": "9.30.0",
|
||||
"eslint-config-next": "15.3.4",
|
||||
"genkit-cli": "^1.13.0",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.4.1",
|
||||
|
|
|
@ -57,7 +57,14 @@ async function getYouTubeVideos(ids: string[]): Promise<Video[]> {
|
|||
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,
|
||||
title: item.snippet.title,
|
||||
}));
|
||||
|
|
|
@ -56,7 +56,14 @@ async function getYouTubeVideos(ids: string[]): Promise<Video[]> {
|
|||
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,
|
||||
title: item.snippet.title,
|
||||
}));
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
import type { Metadata } from 'next';
|
||||
import { Inter } from 'next/font/google';
|
||||
import './globals.css';
|
||||
import { Toaster } from '@/components/ui/toaster';
|
||||
import { ThemeProvider } from '@/components/theme-provider';
|
||||
|
||||
const inter = Inter({ subsets: ['latin'] });
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Cheating Chelsea Exposed - The Truth About Chelsea Smallwood',
|
||||
description:
|
||||
|
@ -61,19 +64,7 @@ export default function RootLayout({
|
|||
}>) {
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<head>
|
||||
<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">
|
||||
<body className={`${inter.className} font-body antialiased`}>
|
||||
<ThemeProvider
|
||||
attribute="class"
|
||||
defaultTheme="system"
|
||||
|
|
|
@ -17,7 +17,7 @@ export default function NotFound() {
|
|||
/>
|
||||
</div>
|
||||
<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're looking for has gone into hiding.
|
||||
</p>
|
||||
<Button asChild size="lg">
|
||||
<Link href="/">Go Back to Home</Link>
|
||||
|
|
|
@ -18,12 +18,12 @@ type ToasterToast = ToastProps & {
|
|||
action?: ToastActionElement
|
||||
}
|
||||
|
||||
const actionTypes = {
|
||||
type ActionType = {
|
||||
ADD_TOAST: "ADD_TOAST",
|
||||
UPDATE_TOAST: "UPDATE_TOAST",
|
||||
DISMISS_TOAST: "DISMISS_TOAST",
|
||||
REMOVE_TOAST: "REMOVE_TOAST",
|
||||
} as const
|
||||
}
|
||||
|
||||
let count = 0
|
||||
|
||||
|
@ -32,8 +32,6 @@ function genId() {
|
|||
return count.toString()
|
||||
}
|
||||
|
||||
type ActionType = typeof actionTypes
|
||||
|
||||
type Action =
|
||||
| {
|
||||
type: ActionType["ADD_TOAST"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue