chore(lint): resolve ESLint warnings#825
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
QA suite report
Result: passed. QA vs
|
| 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
Lighthouse (CI)Lighthouse vs
|
| 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 | — |
There was a problem hiding this comment.
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-componentsfor 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
pathPartsis 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 whenlocation.pathnamehasn’t changed, which can cause unnecessarystartTransition/state-set churn. Prefer memoizingpathPartswithuseMemo([location.pathname])(or derive it inside the effect) so the dependency is stable, or removepathPartsfrom deps and rely onlocation.pathnamesincepathPartsis 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.
979c75f to
e669fd3
Compare
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This Pull Request clears ESLint warnings across the SortVision app and tightens ESLint config so
pnpm lintpasses cleanly.It changes the following:
react-refresh/only-export-componentsfor context, shadcn UI,MobileOverlay, andLanguageDetection(multi-export patterns that are intentional).generateMetadata,generateStaticParams, etc.) where applicable.getAlgorithmColorinCurrentRunMetrics; small tweaks inApp,PWAInstaller,MobileOverlay, feedback/chatbot utilities, and public algorithm snippets.Testing
cd SortVision && pnpm run format:check && pnpm run lint && pnpm run test:unit