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:
parent
d1f8870379
commit
ab87b8ab83
12 changed files with 5 additions and 19 deletions
|
|
@ -255,7 +255,6 @@ export const EditProfileForm: React.FC = () => {
|
|||
});
|
||||
} catch (error) {
|
||||
console.error('Failed to update profile:', error);
|
||||
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: 'Failed to publish profile. Check your relay connections in Settings > Relays',
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ export function GearSwapItemCard({ item, trustScore, salesCount, isFollowing }:
|
|||
: null;
|
||||
|
||||
// Get price type label
|
||||
const priceTypeLabel = item.priceType ? PRICE_TYPES[item.priceType]?.label : null;
|
||||
|
||||
// Skateboard rating for seller
|
||||
const sellerRating = getSkateboardRating(salesCount);
|
||||
|
|
@ -98,7 +97,6 @@ export function GearSwapItemCard({ item, trustScore, salesCount, isFollowing }:
|
|||
const trustLevel = getTrustLevel(trustScore);
|
||||
const trustBadge = SELLER_TRUST_BADGES[trustLevel];
|
||||
|
||||
const isOwnListing = user?.pubkey === item.pubkey;
|
||||
const isSold = item.status === 'sold';
|
||||
|
||||
const handleMarkSold = async () => {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ export function RelatrSettings() {
|
|||
});
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// Skip invalid JSON
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -583,7 +583,6 @@ function CVMStatus({ connected }: { connected: boolean | null }) {
|
|||
|
||||
function ChatText({ text }: { text: string }) {
|
||||
// Split on markdown links [label](url) and bare URLs
|
||||
const parts = text.split(/(\[([^\]]+)\]\((https?:\/\/[^)]+)\)|https?:\/\/\S+)/g);
|
||||
const elements: React.ReactNode[] = [];
|
||||
let i = 0;
|
||||
// Use a regex to find all links in order
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ export function useBatchTrustScores(pubkeys: string[]) {
|
|||
if (metadata.nip05) {
|
||||
scores.set(profileEvent.pubkey, 30);
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// Ignore JSON parse errors
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export function useLoggedInAccounts() {
|
|||
[{ kinds: [0], authors: loginPubkeys }],
|
||||
{ signal: AbortSignal.any([signal, AbortSignal.timeout(5000)]) },
|
||||
);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
console.warn('[useLoggedInAccounts] Primary relay query failed, trying fallback relays...');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export function useSellerInfo(pubkey: string | undefined) {
|
|||
{ signal }
|
||||
).catch(() => [])
|
||||
);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Ignore individual relay errors
|
||||
}
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ export function useSellerInfo(pubkey: string | undefined) {
|
|||
const metadata = JSON.parse(profile.content);
|
||||
hasNip05 = !!metadata.nip05;
|
||||
nip05 = metadata.nip05;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// Ignore JSON parse errors
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,10 +96,8 @@ export default function CoachDetailPage() {
|
|||
|
||||
const isCoach = profile?.profileType === 'coach';
|
||||
const isFilmer = profile?.profileType === 'filmer';
|
||||
const isEditor = profile?.profileType === 'editor';
|
||||
const isPhotographer = profile?.profileType === 'photographer';
|
||||
const isBuilder = profile?.profileType === 'builder';
|
||||
const isArtist = profile?.profileType === 'artist';
|
||||
const isGraffiti = profile?.profileType === 'graffiti';
|
||||
const isTattoo = profile?.profileType === 'tattoo';
|
||||
const isTrainer = profile?.profileType === 'trainer';
|
||||
|
|
@ -111,7 +109,6 @@ export default function CoachDetailPage() {
|
|||
});
|
||||
|
||||
const metadata = author.data?.metadata;
|
||||
const displayName = metadata?.name ?? genUserName(profile?.pubkey || '');
|
||||
|
||||
if (isLoading) {
|
||||
return <CoachDetailSkeleton />;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ export default function CreateListingPage() {
|
|||
const fromStash = searchParams.get('fromStash') === 'true';
|
||||
// Where to return after publishing / when going back (e.g. /marketplace).
|
||||
const returnTo = searchParams.get('returnTo') || '';
|
||||
const stashId = searchParams.get('stashId');
|
||||
|
||||
// Form state - initialize from URL params if coming from stash
|
||||
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)
|
||||
const canProceedWithListing = !restrictions.requiresFee || feePaid;
|
||||
|
||||
// Get selected spot details
|
||||
const selectedSpot = useMemo(() => {
|
||||
|
|
|
|||
|
|
@ -769,7 +769,6 @@ export default function MapPage() {
|
|||
}
|
||||
};
|
||||
|
||||
const categoryKeys = Object.keys(SPOT_CATEGORIES);
|
||||
|
||||
// Fetch BTC Map places when enabled
|
||||
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';
|
||||
|
||||
// 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
|
||||
const mobileLayerCount = [showSpots, showShops, showGear, showTours, showEvents, showCrews].filter(Boolean).length;
|
||||
const totalPrimaryLayers = 6;
|
||||
|
|
|
|||
|
|
@ -629,7 +629,6 @@ function useWitnessName(pubkey: string) {
|
|||
// No flex-1 / flex-grow — every row has a fixed pixel height.
|
||||
function RiderFront({ d }: { d: CardData }) {
|
||||
const witnessedBadges = d.receivedBadges.slice(0, 2);
|
||||
const qrUrl = verifyUrl(d.pubkey);
|
||||
|
||||
return (
|
||||
// absolute inset — fills the card exactly
|
||||
|
|
@ -760,7 +759,6 @@ function RiderFront({ d }: { d: CardData }) {
|
|||
|
||||
// ─── Card visual: Park Access front ──────────────────────────────────────────
|
||||
function ParkFront({ d }: { d: CardData }) {
|
||||
const qrUrl = verifyUrl(d.pubkey);
|
||||
|
||||
return (
|
||||
<div className="absolute inset-0" style={{ padding: '10px 10px 20px 10px' }}>
|
||||
|
|
|
|||
|
|
@ -273,7 +273,6 @@ export default function SignersPage() {
|
|||
{/* Signer Sections */}
|
||||
<div className="container px-4 py-8 space-y-8">
|
||||
{platformOrder.map((platform, index) => {
|
||||
const isUserPlatform = index === 0 && isMobile;
|
||||
|
||||
if (platform === 'android') {
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue