chore(lint): reach zero warnings (react-refresh)

The last 7 react-refresh warnings are dev-only HMR DX from intentional
component+hook/helper colocations (EventCountdown, SortDropdown, TrustFilter,
LanguageContext, NewsletterPage). Splitting them into new files is broad import
churn for no runtime benefit, so each carries a justified file-level disable.

npm test: 0 errors, 0 warnings, 101 tests; boot smoke green.
This commit is contained in:
SkateSpots 2026-09-26 22:23:45 +07:00
parent 6def78fffe
commit c0aec3d912
6 changed files with 11 additions and 6 deletions

View file

@ -79,12 +79,12 @@ session with **no other memory of this project**. So:
- **Lazy routes**: every route uses `lazyWithRetry` (`src/lib/lazyWithRetry.ts`) — - **Lazy routes**: every route uses `lazyWithRetry` (`src/lib/lazyWithRetry.ts`) —
retries, then one full reload per session, so a chunk-load failure self-heals retries, then one full reload per session, so a chunk-load failure self-heals
instead of showing the error boundary. instead of showing the error boundary.
- **Baselines** (verified 2026-09-26): `npm test` → 0 errors, **7 warnings** - **Baselines** (verified 2026-09-26): `npm test` → **0 errors, 0 warnings**,
(all `react-refresh/only-export-components`), **101 tests**, build ok. **101 tests**, build ok. `package.json` version **1.4.5**.
`package.json` version **1.4.5**. - ✅ Lint is **clean**: `no-explicit-any` = 0 · `react-hooks/exhaustive-deps` = 0
- ✅ `no-explicit-any` = 0 · ✅ `react-hooks/exhaustive-deps` = 0 · · `no-unused-vars` = 0 · `react-refresh` = 0 (the last were intentional
✅ `no-unused-vars` = 0. Remaining: `react-refresh` (dev-only DX — files component+hook/helper colocations carrying a justified file-level disable).
exporting non-components next to components; fix by moving the export out). Keep it at zero — don't reintroduce any.
- ⚠️ Do **not** mass-fix `no-unused-vars` by name or blanket rename — shadowed - ⚠️ Do **not** mass-fix `no-unused-vars` by name or blanket rename — shadowed
names and typed shorthand destructuring make it unsafe. Fix position-precise. names and typed shorthand destructuring make it unsafe. Fix position-precise.
Renaming a component to `_Name` also trips `rules-of-hooks` — delete it or Renaming a component to `_Name` also trips `rules-of-hooks` — delete it or

View file

@ -1,3 +1,4 @@
/* eslint-disable react-refresh/only-export-components -- EventCountdown component + useEventStatus hook are colocated by design (dev-only HMR rule). */
import { useEffect, useMemo, useState } from 'react'; import { useEffect, useMemo, useState } from 'react';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';

View file

@ -1,3 +1,4 @@
/* eslint-disable react-refresh/only-export-components -- SortDropdown component + its sort option constants/helpers are intentionally colocated (dev-only HMR rule). */
import { ArrowUpDown, Clock, TrendingUp, MapPin, Zap, Shield } from 'lucide-react'; import { ArrowUpDown, Clock, TrendingUp, MapPin, Zap, Shield } from 'lucide-react';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';

View file

@ -1,3 +1,4 @@
/* eslint-disable react-refresh/only-export-components -- TrustFilter component + its level constants/helpers are intentionally colocated (dev-only HMR rule). */
import { Shield, CheckCircle2, Users } from 'lucide-react'; import { Shield, CheckCircle2, Users } from 'lucide-react';
import { Badge } from '@/components/ui/badge'; import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';

View file

@ -1,3 +1,4 @@
/* eslint-disable react-refresh/only-export-components -- LanguageProvider + useTranslation hook + context are colocated by design (idiomatic context module; dev-only HMR rule). */
import { createContext, useContext, useState, useCallback, ReactNode, useEffect } from 'react'; import { createContext, useContext, useState, useCallback, ReactNode, useEffect } from 'react';
import { useLocalStorage } from '@/hooks/useLocalStorage'; import { useLocalStorage } from '@/hooks/useLocalStorage';

View file

@ -1,3 +1,4 @@
/* eslint-disable react-refresh/only-export-components -- NewsletterPage component + its newsletter data exports are intentionally colocated (dev-only HMR rule). */
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useSeoMeta } from '@unhead/react'; import { useSeoMeta } from '@unhead/react';
import { nip19 } from 'nostr-tools'; import { nip19 } from 'nostr-tools';