Skip to content

fix: resolve all ESLint warnings in web/ (issue #437) - #526

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
Maqbool61:fix/eslint-warnings-437
Jul 24, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
Maqbool61:fix/eslint-warnings-437

Conversation

@Maqbool61

Copy link
Copy Markdown
Contributor

Summary

Fixes #437

Eliminates all 8 ESLint warnings from npx eslint src with 0 regressions
(npx tsc --noEmit and ✓ Compiled successfully both pass clean).


Changes

competitors/page.tsx — Remove 3 unused components + orphaned imports

VisibilityBar and ColHead were defined but never referenced in JSX.
Deleting ColHead exposed InfoTip as also orphaned (it was only used
by ColHead), so that was removed too. Their imports were then cleaned up:

  • Removed useRef from the react import
  • Removed import { createPortal } from 'react-dom'
  • Removed HelpCircle from the lucide-react import block

shopping/page.tsx — Suppress no-img-element with reason comment

The <img> tag at line 693 loads product images from arbitrary merchant
domains. Migrating to next/image would require adding an open-ended
wildcard to remotePatterns in next.config.ts, which is a broader
change outside the scope of this issue. Added a scoped
eslint-disable-next-line comment with an explanation.

traffic/page.tsx — Remove unused variable isCloud

const isCloud = process.env.NEXT_PUBLIC_IS_CLOUD === 'true' was
assigned at line 138 but never read anywhere in the file. Deleted.

opengraph-image.tsx — Remove stale eslint-disable directive

The {/* eslint-disable-next-line @next/next/no-img-element */} comment
was flagged as unused because ESLint's no-img-element rule does not
fire inside Next.js ImageResponse JSX. The directive was suppressing
nothing, so it was removed. The <img> tag itself is untouched.

ai-provider-avatar.tsx — Suppress no-img-element with reason comment

The <img> tag at line 168 loads AI provider favicon icons from
arbitrary remote domains. Same reasoning as shopping/page.tsx — an
open-ended remotePatterns wildcard would be needed for next/image,
which is out of scope here. Added a scoped eslint-disable-next-line
comment with an explanation.

sign-in-form.tsx — Remove unused destructured variable data

const { data, error } at line 33 — data was destructured from the
Supabase signInWithPassword response but never used. Changed to
const { error }.

sign-up-form.tsx — Remove unused import Link

Link was imported from @/i18n/navigation at line 6 but not used
anywhere in the component. Removed from the import.


Testing

npx eslint src     # 0 warnings, 0 errors
npx tsc --noEmit   # 0 errors

- Remove unused VisibilityBar, InfoTip, ColHead components and their
  orphaned imports (useRef, createPortal, HelpCircle) from competitors/page.tsx
- Add scoped eslint-disable comments with reason for <img> tags in
  shopping/page.tsx and ai-provider-avatar.tsx (arbitrary remote domains
  make next/image remotePatterns would need an open-ended wildcard)
- Remove stale eslint-disable comment from opengraph-image.tsx
- Remove unused variable isCloud from traffic/page.tsx
- Remove unused destructured variable data from sign-in-form.tsx
- Remove unused import Link from sign-up-form.tsx

Fixes #437
@gkhngyk
gkhngyk merged commit 5b00752 into ansvisor:main Jul 24, 2026
4 checks passed
@Maqbool61
Maqbool61 deleted the fix/eslint-warnings-437 branch July 24, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up the 9 outstanding ESLint warnings in web/

2 participants