added a linter and tried it out. that was not fun
This commit is contained in:
@@ -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