master #9
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||||
// @ts-check
|
// @ts-check
|
||||||
import { defineConfig, envField } from 'astro/config';
|
import { defineConfig, envField } from 'astro/config';
|
||||||
|
|
||||||
|
|||||||
9
eslint.config.ts
Normal file
9
eslint.config.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import js from "@eslint/js";
|
||||||
|
import globals from "globals";
|
||||||
|
import tseslint from "typescript-eslint";
|
||||||
|
import { defineConfig } from "eslint/config";
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], plugins: { js }, extends: ["js/recommended"], languageOptions: { globals: globals.browser } },
|
||||||
|
tseslint.configs.recommended,
|
||||||
|
]);
|
||||||
1167
package-lock.json
generated
1167
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@@ -9,7 +9,8 @@
|
|||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro"
|
"astro": "astro",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/react": "^5.0.4",
|
"@astrojs/react": "^5.0.4",
|
||||||
@@ -24,6 +25,11 @@
|
|||||||
"vite": "^6.4.2"
|
"vite": "^6.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^25.6.0"
|
"@eslint/js": "^10.0.1",
|
||||||
|
"@types/node": "^25.6.0",
|
||||||
|
"eslint": "^10.3.0",
|
||||||
|
"globals": "^17.6.0",
|
||||||
|
"jiti": "^2.6.1",
|
||||||
|
"typescript-eslint": "^8.59.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
weekdayShort,
|
weekdayShort,
|
||||||
type MovieInterface,
|
type MovieInterface,
|
||||||
type ITMDBResponse,
|
type ITMDBResponse,
|
||||||
|
type ITMDBMovie,
|
||||||
} from "../scripts/bigConstants";
|
} from "../scripts/bigConstants";
|
||||||
|
|
||||||
async function getTopMovies(): Promise<MovieInterface[]> {
|
async function getTopMovies(): Promise<MovieInterface[]> {
|
||||||
@@ -24,7 +25,7 @@ async function getTopMovies(): Promise<MovieInterface[]> {
|
|||||||
|
|
||||||
if (!data.results) return [];
|
if (!data.results) return [];
|
||||||
|
|
||||||
return data.results?.map((movie) => ({
|
return (data.results as ITMDBMovie[]).map((movie: ITMDBMovie) => ({
|
||||||
id: movie.id,
|
id: movie.id,
|
||||||
title: movie.title || "Unknown Title",
|
title: movie.title || "Unknown Title",
|
||||||
poster: movie.poster_path
|
poster: movie.poster_path
|
||||||
@@ -37,7 +38,9 @@ async function getTopMovies(): Promise<MovieInterface[]> {
|
|||||||
duration: 120, // Discover doesn't provide duration
|
duration: 120, // Discover doesn't provide duration
|
||||||
fsk: "12",
|
fsk: "12",
|
||||||
description: movie.overview || "No description available.",
|
description: movie.overview || "No description available.",
|
||||||
backdrop: movie.backdrop_path,
|
backdrop: movie.backdrop_path
|
||||||
|
? `${IMAGE_BASE_URL}${movie.backdrop_path}`
|
||||||
|
: "/placeholder.jpg",
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,19 +27,19 @@ export const timePatterns = [
|
|||||||
export const weekdayShort = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"];
|
export const weekdayShort = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"];
|
||||||
|
|
||||||
// Shared State
|
// Shared State
|
||||||
export let cart: any[] = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("eagleCart") || '[]') : '[]');
|
export const cart: unknown[] = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("eagleCart") || '[]') : '[]');
|
||||||
export let occupiedSeatsData = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("eagleOccupied") || '{}') : '{}');
|
export let occupiedSeatsData = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("eagleOccupied") || '{}') : '{}');
|
||||||
export let users: any[] = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("eagleUsers") || '[]') : '[]');
|
export const users: unknown[] = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("eagleUsers") || '[]') : '[]');
|
||||||
export let currentUser: any = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("currentUser") || 'null') : 'null');
|
export let currentUser: unknown = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("currentUser") || 'null') : 'null');
|
||||||
|
|
||||||
export function updateCart(newCart: any[]) {
|
export function updateCart(newCart: unknown[]) {
|
||||||
cart.splice(0, cart.length, ...newCart);
|
cart.splice(0, cart.length, ...newCart);
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
localStorage.setItem("eagleCart", JSON.stringify(cart));
|
localStorage.setItem("eagleCart", JSON.stringify(cart));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateOccupiedSeats(newData: any) {
|
export function updateOccupiedSeats(newData: unknown) {
|
||||||
occupiedSeatsData = newData;
|
occupiedSeatsData = newData;
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
localStorage.setItem("eagleOccupied", JSON.stringify(occupiedSeatsData));
|
localStorage.setItem("eagleOccupied", JSON.stringify(occupiedSeatsData));
|
||||||
@@ -57,7 +57,7 @@ export function persistUsers() {
|
|||||||
if (typeof window !== 'undefined') localStorage.setItem("eagleUsers", JSON.stringify(users));
|
if (typeof window !== 'undefined') localStorage.setItem("eagleUsers", JSON.stringify(users));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function persistCurrentUser(user: any) {
|
export function persistCurrentUser(user: unknown) {
|
||||||
currentUser = user;
|
currentUser = user;
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
if (currentUser) localStorage.setItem("currentUser", JSON.stringify(currentUser));
|
if (currentUser) localStorage.setItem("currentUser", JSON.stringify(currentUser));
|
||||||
@@ -70,8 +70,8 @@ export interface User {
|
|||||||
lastName: string;
|
lastName: string;
|
||||||
email: string;
|
email: string;
|
||||||
hashedPassword: string;
|
hashedPassword: string;
|
||||||
orders: any[];
|
orders: unknown[];
|
||||||
paymentMethods: any[];
|
paymentMethods: unknown[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MovieInterface {
|
export interface MovieInterface {
|
||||||
@@ -89,7 +89,20 @@ export interface MovieInterface {
|
|||||||
|
|
||||||
export interface ITMDBResponse {
|
export interface ITMDBResponse {
|
||||||
page: number;
|
page: number;
|
||||||
results: any[];
|
results: unknown[];
|
||||||
total_pages: number;
|
total_pages: number;
|
||||||
total_results: number;
|
total_results: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ITMDBMovie {
|
||||||
|
id: number;
|
||||||
|
title: string;
|
||||||
|
poster_path: string;
|
||||||
|
vote_average: number;
|
||||||
|
release_date: string;
|
||||||
|
genre_ids: number[];
|
||||||
|
runtime: number;
|
||||||
|
age_rating: string;
|
||||||
|
overview: string;
|
||||||
|
backdrop_path: string;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user