forked from Aaron/Kino-Website
added a linter and tried it out. that was not fun
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
// @ts-check
|
||||
import { defineConfig, envField } from 'astro/config';
|
||||
|
||||
@@ -11,7 +12,7 @@ export default defineConfig({
|
||||
include: ['**/react/*']
|
||||
})],
|
||||
vite: {
|
||||
// @ts-ignore
|
||||
//@ts-ignore
|
||||
plugins: [tailwindcss({optimize:false})]
|
||||
},
|
||||
env: {
|
||||
|
||||
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",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro"
|
||||
"astro": "astro",
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/react": "^5.0.4",
|
||||
@@ -24,6 +25,11 @@
|
||||
"vite": "^6.4.2"
|
||||
},
|
||||
"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,
|
||||
type MovieInterface,
|
||||
type ITMDBResponse,
|
||||
type ITMDBMovie,
|
||||
} from "../scripts/bigConstants";
|
||||
|
||||
async function getTopMovies(): Promise<MovieInterface[]> {
|
||||
@@ -24,7 +25,7 @@ async function getTopMovies(): Promise<MovieInterface[]> {
|
||||
|
||||
if (!data.results) return [];
|
||||
|
||||
return data.results?.map((movie) => ({
|
||||
return (data.results as ITMDBMovie[]).map((movie: ITMDBMovie) => ({
|
||||
id: movie.id,
|
||||
title: movie.title || "Unknown Title",
|
||||
poster: movie.poster_path
|
||||
@@ -37,7 +38,9 @@ async function getTopMovies(): Promise<MovieInterface[]> {
|
||||
duration: 120, // Discover doesn't provide duration
|
||||
fsk: "12",
|
||||
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"];
|
||||
|
||||
// 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 users: any[] = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("eagleUsers") || '[]') : '[]');
|
||||
export let currentUser: any = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("currentUser") || 'null') : 'null');
|
||||
export const users: unknown[] = JSON.parse(typeof window !== 'undefined' ? (localStorage.getItem("eagleUsers") || '[]') : '[]');
|
||||
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);
|
||||
if (typeof window !== 'undefined') {
|
||||
localStorage.setItem("eagleCart", JSON.stringify(cart));
|
||||
}
|
||||
}
|
||||
|
||||
export function updateOccupiedSeats(newData: any) {
|
||||
export function updateOccupiedSeats(newData: unknown) {
|
||||
occupiedSeatsData = newData;
|
||||
if (typeof window !== 'undefined') {
|
||||
localStorage.setItem("eagleOccupied", JSON.stringify(occupiedSeatsData));
|
||||
@@ -57,7 +57,7 @@ export function persistUsers() {
|
||||
if (typeof window !== 'undefined') localStorage.setItem("eagleUsers", JSON.stringify(users));
|
||||
}
|
||||
|
||||
export function persistCurrentUser(user: any) {
|
||||
export function persistCurrentUser(user: unknown) {
|
||||
currentUser = user;
|
||||
if (typeof window !== 'undefined') {
|
||||
if (currentUser) localStorage.setItem("currentUser", JSON.stringify(currentUser));
|
||||
@@ -70,8 +70,8 @@ export interface User {
|
||||
lastName: string;
|
||||
email: string;
|
||||
hashedPassword: string;
|
||||
orders: any[];
|
||||
paymentMethods: any[];
|
||||
orders: unknown[];
|
||||
paymentMethods: unknown[];
|
||||
}
|
||||
|
||||
export interface MovieInterface {
|
||||
@@ -89,7 +89,20 @@ export interface MovieInterface {
|
||||
|
||||
export interface ITMDBResponse {
|
||||
page: number;
|
||||
results: any[];
|
||||
results: unknown[];
|
||||
total_pages: 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