chore(lint): remove safely-detectable unused locals

Position-based cleanup (no name collisions) of unused catch bindings and unused
single-line pure consts across 12 files. Automated destructure/prop removals
were proven unsafe (shadowed names + typed shorthand), so those remain.

Warning backlog: 76 -> 60 (39 no-unused-vars, 14 exhaustive-deps, 7 react-refresh).
Gate green: 101 tests, 0 errors, boot smoke passing.
This commit is contained in:
SkateSpots 2026-09-26 21:58:03 +07:00
parent d1f8870379
commit ab87b8ab83
12 changed files with 5 additions and 19 deletions

View file

@ -255,7 +255,6 @@ export const EditProfileForm: React.FC = () => {
}); });
} catch (error) { } catch (error) {
console.error('Failed to update profile:', error); console.error('Failed to update profile:', error);
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
toast({ toast({
title: 'Error', title: 'Error',
description: 'Failed to publish profile. Check your relay connections in Settings > Relays', description: 'Failed to publish profile. Check your relay connections in Settings > Relays',

View file

@ -89,7 +89,6 @@ export function GearSwapItemCard({ item, trustScore, salesCount, isFollowing }:
: null; : null;
// Get price type label // Get price type label
const priceTypeLabel = item.priceType ? PRICE_TYPES[item.priceType]?.label : null;
// Skateboard rating for seller // Skateboard rating for seller
const sellerRating = getSkateboardRating(salesCount); const sellerRating = getSkateboardRating(salesCount);
@ -98,7 +97,6 @@ export function GearSwapItemCard({ item, trustScore, salesCount, isFollowing }:
const trustLevel = getTrustLevel(trustScore); const trustLevel = getTrustLevel(trustScore);
const trustBadge = SELLER_TRUST_BADGES[trustLevel]; const trustBadge = SELLER_TRUST_BADGES[trustLevel];
const isOwnListing = user?.pubkey === item.pubkey;
const isSold = item.status === 'sold'; const isSold = item.status === 'sold';
const handleMarkSold = async () => { const handleMarkSold = async () => {

View file

@ -63,7 +63,7 @@ export function RelatrSettings() {
}); });
return; return;
} }
} catch (e) { } catch {
// Skip invalid JSON // Skip invalid JSON
} }
} }

View file

@ -583,7 +583,6 @@ function CVMStatus({ connected }: { connected: boolean | null }) {
function ChatText({ text }: { text: string }) { function ChatText({ text }: { text: string }) {
// Split on markdown links [label](url) and bare URLs // Split on markdown links [label](url) and bare URLs
const parts = text.split(/(\[([^\]]+)\]\((https?:\/\/[^)]+)\)|https?:\/\/\S+)/g);
const elements: React.ReactNode[] = []; const elements: React.ReactNode[] = [];
let i = 0; let i = 0;
// Use a regex to find all links in order // Use a regex to find all links in order

View file

@ -101,7 +101,7 @@ export function useBatchTrustScores(pubkeys: string[]) {
if (metadata.nip05) { if (metadata.nip05) {
scores.set(profileEvent.pubkey, 30); scores.set(profileEvent.pubkey, 30);
} }
} catch (e) { } catch {
// Ignore JSON parse errors // Ignore JSON parse errors
} }
} }

View file

@ -42,7 +42,7 @@ export function useLoggedInAccounts() {
[{ kinds: [0], authors: loginPubkeys }], [{ kinds: [0], authors: loginPubkeys }],
{ signal: AbortSignal.any([signal, AbortSignal.timeout(5000)]) }, { signal: AbortSignal.any([signal, AbortSignal.timeout(5000)]) },
); );
} catch (error) { } catch {
console.warn('[useLoggedInAccounts] Primary relay query failed, trying fallback relays...'); console.warn('[useLoggedInAccounts] Primary relay query failed, trying fallback relays...');
} }

View file

@ -65,7 +65,7 @@ export function useSellerInfo(pubkey: string | undefined) {
{ signal } { signal }
).catch(() => []) ).catch(() => [])
); );
} catch (error) { } catch {
// Ignore individual relay errors // Ignore individual relay errors
} }
} }
@ -93,7 +93,7 @@ export function useSellerInfo(pubkey: string | undefined) {
const metadata = JSON.parse(profile.content); const metadata = JSON.parse(profile.content);
hasNip05 = !!metadata.nip05; hasNip05 = !!metadata.nip05;
nip05 = metadata.nip05; nip05 = metadata.nip05;
} catch (e) { } catch {
// Ignore JSON parse errors // Ignore JSON parse errors
} }

View file

@ -96,10 +96,8 @@ export default function CoachDetailPage() {
const isCoach = profile?.profileType === 'coach'; const isCoach = profile?.profileType === 'coach';
const isFilmer = profile?.profileType === 'filmer'; const isFilmer = profile?.profileType === 'filmer';
const isEditor = profile?.profileType === 'editor';
const isPhotographer = profile?.profileType === 'photographer'; const isPhotographer = profile?.profileType === 'photographer';
const isBuilder = profile?.profileType === 'builder'; const isBuilder = profile?.profileType === 'builder';
const isArtist = profile?.profileType === 'artist';
const isGraffiti = profile?.profileType === 'graffiti'; const isGraffiti = profile?.profileType === 'graffiti';
const isTattoo = profile?.profileType === 'tattoo'; const isTattoo = profile?.profileType === 'tattoo';
const isTrainer = profile?.profileType === 'trainer'; const isTrainer = profile?.profileType === 'trainer';
@ -111,7 +109,6 @@ export default function CoachDetailPage() {
}); });
const metadata = author.data?.metadata; const metadata = author.data?.metadata;
const displayName = metadata?.name ?? genUserName(profile?.pubkey || '');
if (isLoading) { if (isLoading) {
return <CoachDetailSkeleton />; return <CoachDetailSkeleton />;

View file

@ -57,7 +57,6 @@ export default function CreateListingPage() {
const fromStash = searchParams.get('fromStash') === 'true'; const fromStash = searchParams.get('fromStash') === 'true';
// Where to return after publishing / when going back (e.g. /marketplace). // Where to return after publishing / when going back (e.g. /marketplace).
const returnTo = searchParams.get('returnTo') || ''; const returnTo = searchParams.get('returnTo') || '';
const stashId = searchParams.get('stashId');
// Form state - initialize from URL params if coming from stash // Form state - initialize from URL params if coming from stash
const [listingType, setListingType] = useState<'selling' | 'wtb'>('selling'); const [listingType, setListingType] = useState<'selling' | 'wtb'>('selling');
@ -96,7 +95,6 @@ export default function CreateListingPage() {
}; };
// Check if user can proceed (fee paid or not required) // Check if user can proceed (fee paid or not required)
const canProceedWithListing = !restrictions.requiresFee || feePaid;
// Get selected spot details // Get selected spot details
const selectedSpot = useMemo(() => { const selectedSpot = useMemo(() => {

View file

@ -769,7 +769,6 @@ export default function MapPage() {
} }
}; };
const categoryKeys = Object.keys(SPOT_CATEGORIES);
// Fetch BTC Map places when enabled // Fetch BTC Map places when enabled
const { data: btcMapPlaces, isLoading: btcMapLoading, error: btcMapError } = useBtcMapPlaces({ const { data: btcMapPlaces, isLoading: btcMapLoading, error: btcMapError } = useBtcMapPlaces({
@ -1021,7 +1020,6 @@ export default function MapPage() {
const hasActiveFilters = searchQuery || selectedCategories.length > 0 || weatherFilter !== 'all' || trustFilter !== 'all' || sortBy !== 'recent'; const hasActiveFilters = searchQuery || selectedCategories.length > 0 || weatherFilter !== 'all' || trustFilter !== 'all' || sortBy !== 'recent';
// Count active layer filters for mobile badge // Count active layer filters for mobile badge
const activeLayerCount = [showSpots, showShops, showGear, showTours, showBtcMap].filter(Boolean).length;
// Count of the primary layers active — shown as a badge on the Layers button // Count of the primary layers active — shown as a badge on the Layers button
const mobileLayerCount = [showSpots, showShops, showGear, showTours, showEvents, showCrews].filter(Boolean).length; const mobileLayerCount = [showSpots, showShops, showGear, showTours, showEvents, showCrews].filter(Boolean).length;
const totalPrimaryLayers = 6; const totalPrimaryLayers = 6;

View file

@ -629,7 +629,6 @@ function useWitnessName(pubkey: string) {
// No flex-1 / flex-grow — every row has a fixed pixel height. // No flex-1 / flex-grow — every row has a fixed pixel height.
function RiderFront({ d }: { d: CardData }) { function RiderFront({ d }: { d: CardData }) {
const witnessedBadges = d.receivedBadges.slice(0, 2); const witnessedBadges = d.receivedBadges.slice(0, 2);
const qrUrl = verifyUrl(d.pubkey);
return ( return (
// absolute inset — fills the card exactly // absolute inset — fills the card exactly
@ -760,7 +759,6 @@ function RiderFront({ d }: { d: CardData }) {
// ─── Card visual: Park Access front ────────────────────────────────────────── // ─── Card visual: Park Access front ──────────────────────────────────────────
function ParkFront({ d }: { d: CardData }) { function ParkFront({ d }: { d: CardData }) {
const qrUrl = verifyUrl(d.pubkey);
return ( return (
<div className="absolute inset-0" style={{ padding: '10px 10px 20px 10px' }}> <div className="absolute inset-0" style={{ padding: '10px 10px 20px 10px' }}>

View file

@ -273,7 +273,6 @@ export default function SignersPage() {
{/* Signer Sections */} {/* Signer Sections */}
<div className="container px-4 py-8 space-y-8"> <div className="container px-4 py-8 space-y-8">
{platformOrder.map((platform, index) => { {platformOrder.map((platform, index) => {
const isUserPlatform = index === 0 && isMobile;
if (platform === 'android') { if (platform === 'android') {
return ( return (