satisfy the linter
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
560003e9158bafe8998e035f21230afbf7c42a79- Parents
-
a04af33 - Tree
a8c5f96
560003e
560003e9158bafe8998e035f21230afbf7c42a79a04af33
a8c5f96| Status | File | + | - |
|---|---|---|---|
| M |
frontend/app/page.tsx
|
8 | 7 |
| M |
frontend/components/Map.tsx
|
1 | 1 |
| M |
frontend/components/RestaurantPanel.tsx
|
1 | 1 |
| M |
frontend/components/ReviewModal.tsx
|
1 | 1 |
| M |
frontend/components/SearchPanel.tsx
|
1 | 1 |
frontend/app/page.tsxmodified@@ -2,8 +2,8 @@ | ||
| 2 | 2 | |
| 3 | 3 | import { useState, useEffect } from 'react'; |
| 4 | 4 | import dynamic from 'next/dynamic'; |
| 5 | -import { MapPin, Plus, Loader2 } from 'lucide-react'; | |
| 6 | -import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; | |
| 5 | +import { Plus, Loader2 } from 'lucide-react'; | |
| 6 | +import { useMutation } from '@tanstack/react-query'; | |
| 7 | 7 | import { Providers } from './providers'; |
| 8 | 8 | import { Loading } from '@/components/Loading'; |
| 9 | 9 | import ReviewModal from '@/components/ReviewModal'; |
@@ -23,7 +23,6 @@ function HomePage() { | ||
| 23 | 23 | const [searchResultsMinimized, setSearchResultsMinimized] = useState(false); |
| 24 | 24 | const [searchResults, setSearchResults] = useState<PlaceSearchResult[]>([]); |
| 25 | 25 | const [restaurants, setRestaurants] = useState<Restaurant[]>([]); |
| 26 | - const queryClient = useQueryClient(); | |
| 27 | 26 | |
| 28 | 27 | // Get user's location |
| 29 | 28 | useEffect(() => { |
@@ -58,8 +57,9 @@ function HomePage() { | ||
| 58 | 57 | } |
| 59 | 58 | alert('Toast rating added! 🍞'); |
| 60 | 59 | }, |
| 61 | - onError: (error: any) => { | |
| 62 | - alert(error.response?.data?.error || 'Failed to add rating'); | |
| 60 | + onError: (error: unknown) => { | |
| 61 | + const err = error as any; | |
| 62 | + alert(err.response?.data?.error || 'Failed to add rating'); | |
| 63 | 63 | }, |
| 64 | 64 | }); |
| 65 | 65 | |
@@ -79,8 +79,9 @@ function HomePage() { | ||
| 79 | 79 | setShowSearchResults(true); |
| 80 | 80 | setSelectedRestaurant(null); // Close any open restaurant panel |
| 81 | 81 | }, |
| 82 | - onError: () => { | |
| 83 | - alert('Failed to search for places'); | |
| 82 | + onError: (error: unknown) => { | |
| 83 | + const err = error as any; | |
| 84 | + alert(err.response?.data?.error || 'Failed to search for places'); | |
| 84 | 85 | }, |
| 85 | 86 | }); |
| 86 | 87 | |
frontend/components/Map.tsxmodified@@ -9,7 +9,7 @@ import { Restaurant } from '@/lib/api'; | ||
| 9 | 9 | |
| 10 | 10 | // Fix for default markers in React-Leaflet |
| 11 | 11 | if (typeof window !== 'undefined') { |
| 12 | - delete (L.Icon.Default.prototype as any)._getIconUrl; | |
| 12 | + delete (L.Icon.Default.prototype as Record<string, any>)._getIconUrl; | |
| 13 | 13 | L.Icon.Default.mergeOptions({ |
| 14 | 14 | iconRetinaUrl: '/leaflet/marker-icon-2x.png', |
| 15 | 15 | iconUrl: '/leaflet/marker-icon.png', |
frontend/components/RestaurantPanel.tsxmodified@@ -26,7 +26,7 @@ export default function RestaurantPanel({ restaurant, onClose, onAddRating }: Re | ||
| 26 | 26 | setShowRatingForm(false); |
| 27 | 27 | setRating(5); |
| 28 | 28 | setReview(''); |
| 29 | - } catch (error) { | |
| 29 | + } catch (_error) { | |
| 30 | 30 | // Error handling done in parent |
| 31 | 31 | } finally { |
| 32 | 32 | setIsSubmitting(false); |
frontend/components/ReviewModal.tsxmodified@@ -23,7 +23,7 @@ export default function ReviewModal({ restaurant, onClose, onSubmit }: ReviewMod | ||
| 23 | 23 | try { |
| 24 | 24 | await onSubmit({ rating, review }); |
| 25 | 25 | onClose(); |
| 26 | - } catch (error) { | |
| 26 | + } catch { | |
| 27 | 27 | // Error handling done in parent |
| 28 | 28 | } finally { |
| 29 | 29 | setIsSubmitting(false); |
frontend/components/SearchPanel.tsxmodified@@ -1,7 +1,7 @@ | ||
| 1 | 1 | 'use client'; |
| 2 | 2 | |
| 3 | 3 | import { useState } from 'react'; |
| 4 | -import { X, ThumbsUp, ThumbsDown, MessageSquare, MapPin, Star } from 'lucide-react'; | |
| 4 | +import { ThumbsUp, ThumbsDown, MessageSquare, MapPin } from 'lucide-react'; | |
| 5 | 5 | import { PlaceSearchResult } from '@/lib/api'; |
| 6 | 6 | |
| 7 | 7 | interface SearchPanelProps { |