Skip to content

chore(lint): resolve ESLint warnings#825

Merged
alienx5499 merged 2 commits into
mainfrom
chore/lint-format-ci
Apr 14, 2026
Merged

chore(lint): resolve ESLint warnings#825
alienx5499 merged 2 commits into
mainfrom
chore/lint-format-ci

Conversation

@alienx5499

Copy link
Copy Markdown
Owner

This Pull Request clears ESLint warnings across the SortVision app and tightens ESLint config so pnpm lint passes cleanly.

It changes the following:

  • ESLint: Turn off react-refresh/only-export-components for context, shadcn UI, MobileOverlay, and LanguageDetection (multi-export patterns that are intentional).
  • ESLint: Allow Next.js App Router export names (generateMetadata, generateStaticParams, etc.) where applicable.
  • Code: Fix or silence unused vars/catches, hook dependency notes, and remove dead getAlgorithmColor in CurrentRunMetrics; small tweaks in App, PWAInstaller, MobileOverlay, feedback/chatbot utilities, and public algorithm snippets.

Testing

  • cd SortVision && pnpm run format:check && pnpm run lint && pnpm run test:unit

@alienx5499 alienx5499 requested a review from Copilot April 14, 2026 04:35
@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sortvision Ready Ready Preview, Comment Apr 14, 2026 4:48am

@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown

QA suite report

Metric Value
Total tests 659
Passed 659
Failed 0
Warnings 0
Pass rate 100.0%
Grade S+
Duration 4.89s

Result: passed.

View workflow run

QA vs main (last successful CI on base branch)

Baseline: last green Continuous integration on main @ 868fc24 (same test:ci suite).

Base This PR Δ passed
Passed 659 659 0
Failed 0 0
Total 659 659

Fixed (failed on base, passing on this PR)

None

New failures (failed on this PR; were not failing on base)

None

Still failing (failed on base and still failing on this PR)

None

@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown

Lighthouse (CI)

View workflow run

Lighthouse vs main (last green CI on base)

Lighthouse (mobile)

Δ = change vs last successful Continuous integration on main (same URLs).

URL Perf Δ A11y Δ Best Δ SEO Δ
http://localhost:3000/ 68 +7 96 93 100
http://localhost:3000/algorithms/config/bubble 76 +2 96 93 100
http://localhost:3000/es 76 -1 96 93 100
http://localhost:3000/contributions/overview 71 +4 96 96 100

Lighthouse (desktop)

Δ = change vs last successful Continuous integration on main (same URLs).

URL Perf Δ A11y Δ Best Δ SEO Δ
http://localhost:3000/ 98 -1 96 96 100
http://localhost:3000/algorithms/config/bubble 97 -1 96 96 100
http://localhost:3000/es 98 96 96 100
http://localhost:3000/contributions/overview 97 -1 96 96 100

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make pnpm lint pass cleanly across the SortVision app by addressing ESLint warnings through targeted code tweaks and ESLint configuration updates.

Changes:

  • Updates ESLint config to allow Next.js App Router export names and disables react-refresh/only-export-components for specific multi-export files.
  • Silences or fixes unused variables / catch bindings, adjusts hook dependency handling, and removes dead code in a metrics panel.
  • Applies small lint-oriented adjustments across UI, feedback, chatbot, server logging, and public algorithm snippet files.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
SortVision/eslint.config.mjs Adds allowed export names for Next/App Router and turns off only-export-components for selected files.
SortVision/src/utils/audioEngine.js Renames an unused parameter to _value to satisfy lint.
SortVision/src/components/panels/metrics/CurrentRunMetrics.jsx Removes unused getAlgorithmColor helper.
SortVision/src/components/feedback/locationService.js Prefixes unused detection functions with _ to silence lint.
SortVision/src/components/feedback/githubService.js Removes unused parseError binding in JSON parse failure path.
SortVision/src/components/feedback/FeedbackModal.jsx Suppresses exhaustive-deps warning for “run on open” effect; removes unused catch bindings.
SortVision/src/components/chatbot/assistantEngine.js Prefixes unused params/functions with _ to satisfy lint.
SortVision/src/components/PWAInstaller.jsx Removes unused refs/import; adjusts effect deps.
SortVision/src/components/MobileOverlay.jsx Updates effect deps to include setMobileOverlayVisible.
SortVision/src/app/[lang]/sitemap.xml/route.js Removes unused catch binding for sitemap read fallback.
SortVision/src/app/[[...slug]]/page.jsx Renames unused params prop to _params.
SortVision/src/App.jsx Adds pathParts to effect dependencies.
SortVision/server/index.js Removes API-key logging-related comments/logic in server startup.
SortVision/public/code/merge/javascript/mergeSort.js Adds void runTestCases; to silence unused warnings.
SortVision/public/code/insertion/javascript/insertionSort.js Adds void insertionSort; to silence unused warnings.
Comments suppressed due to low confidence (2)

SortVision/src/components/feedback/locationService.js:102

  • _detectWithIPApi (and the other _detectWith* helpers below) are not referenced anywhere in this module after the rename, so the external-service implementation is currently dead code. If IP-based lookup is intentionally disabled, consider removing these helpers or gating them behind a feature flag with a short comment explaining when/how they should be re-enabled.
/**
 * Primary service: IP-API.com (free, reliable, detailed)
 */
const _detectWithIPApi = async () => {
  const response = await fetch(
    'https://ip-api.com/json/?fields=status,message,country,countryCode,region,regionName,city,lat,lon,timezone,isp,org,as,query',
    {
      timeout: 5000,
    }
  );

SortVision/src/App.jsx:213

  • pathParts is recreated on every render (split().filter() returns a new array). Adding it to the effect dependency list will make this routing effect run after every render even when location.pathname hasn’t changed, which can cause unnecessary startTransition/state-set churn. Prefer memoizing pathParts with useMemo([location.pathname]) (or derive it inside the effect) so the dependency is stable, or remove pathParts from deps and rely on location.pathname since pathParts is fully derived from it.
    }
  }, [
    location.pathname,
    pathParts,
    tabFromPath,
    isAlgorithmPath,
    isContributionPath,
    contributionSection,
    navigate,
  ]);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread SortVision/src/components/chatbot/assistantEngine.js Outdated
Comment thread SortVision/public/code/merge/javascript/mergeSort.js Outdated
Comment thread SortVision/public/code/insertion/javascript/insertionSort.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread SortVision/src/App.jsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alienx5499 alienx5499 merged commit 1d1d3c3 into main Apr 14, 2026
23 checks passed
@alienx5499 alienx5499 deleted the chore/lint-format-ci branch May 3, 2026 14:01
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.

2 participants