Repository navigation
[WIP] Fix codebase errors for successful deployment on Vercel - #2
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: aayu5hgit <86314754+aayu5hgit@users.noreply.github.com>
Co-authored-by: aayu5hgit <86314754+aayu5hgit@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes ESLint errors and warnings that were preventing successful deployment on Vercel. The changes focus on cleaning up unused imports, variables, and fixing React/JSX compliance issues to ensure the build passes with CI=true (which treats warnings as errors).
Changes:
- Removed unused imports and variables across 25+ component and page files to eliminate ESLint errors
- Fixed accessibility issues including redundant
role="list"attributes and invalidhref="#"links - Added build configuration files (
.npmrcwithlegacy-peer-deps=trueand updated.gitignoreto exclude/build)
Reviewed changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
.npmrc |
Added legacy-peer-deps=true to resolve peer dependency conflicts during npm install |
.gitignore |
Added /build directory to exclude build artifacts from version control |
src/App.js |
Removed unused imports (Header, Link, Navigate, useTranslation, useEffect, vol) and variables (transcript, isListening, handleListing) |
src/firebase.js |
Changed unused analytics variable to side-effect only call of getAnalytics(app) |
src/MyPages/profile.js |
Removed unused PaperClipIcon import |
src/MyPages/Science.js |
Removed unused imports (SubjectCards, NavLink, Banner) |
src/MyPages/Math.js |
Removed unused imports (SubjectCards, NavLink, Banner) |
src/MyPages/Infor.js |
Removed unused imports (useState, img, mute) and destructured variable (pause) |
src/MyPages/Home.js |
Removed unused NavLink import |
src/MyPages/Footer.js |
Removed unused icon imports (FaLinkedin, FaFacebookSquare, FaInstagramSquare, FaTwitterSquare) and routing imports; fixed empty href attributes by pointing to home page |
src/MyPages/English.js |
Removed unused NavLink import |
src/MyPages/Coursecat.js |
Removed unused imports (Catalogue, NavLink, Banner) |
src/MyComponents/login.js |
Removed unused imports (Header, LockClosedIcon) and errorMessage variables; fixed useEffect dependency array to include navigate |
src/MyComponents/leaders.js |
Removed redundant role="list" attribute from <ul> element |
src/MyComponents/banner.js |
Changed invalid href="#" to proper destination href="/ngoenroll" |
src/MyComponents/Videos.js |
Removed unused imports (border, useEffect, CardHeader, CardBody, CardFooter, Image, Divider) and unused handleClick function |
src/MyComponents/SubjectCards.js |
Removed unused imports and functionality (useState, Link, toast, braille, Toaster) and unused handleClick function; simplified image alt text |
src/MyComponents/Sidebarvideos.js |
Removed unused HStack import |
src/MyComponents/ScienceCatalogue.js |
Removed unused imports (Card, profile) and unused string variables (evs, evs2, evsprac) |
src/MyComponents/Ngoenroll.js |
Removed unused NavLink import; partially converted class to className for Link element |
src/MyComponents/MathCatalogue.js |
Removed unused imports (Card, NavLink) |
src/MyComponents/Header.js |
Removed unused state variables (navbarOpen, setNavbarOpen) |
src/MyComponents/EnglishCatalogue.js |
Removed unused imports (Card, NavLink) |
src/MyComponents/Contact.js |
Removed unused img_x import |
src/MyComponents/Chart.js |
Changed named import to side-effect import for chart.js/auto (correct pattern for Chart.js v3+) |
src/MyComponents/Catalogue.js |
Removed unused imports (Card, NavLink) |
src/MyComponents/About1.js |
Removed unused lead import; removed redundant role="list" attribute |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <Link | ||
| to="/" | ||
| className="btn btn-warning nav-link active" | ||
| style={{ width: "10rem" }} | ||
| > | ||
| {/* Enroll */} | ||
| <Link to="/" class="nav-link active">Sign Out</Link> | ||
| </a> | ||
| Sign Out | ||
| </Link> |
There was a problem hiding this comment.
This change converts class to className for the Link element, but the rest of the file still uses class instead of className (lines 10-34). In React/JSX, all HTML attributes should use className instead of class. This inconsistency should be resolved by converting all remaining class attributes in this file to className for proper JSX syntax.
src/App.js- remove unused imports/vars (Header, Link, Navigate, useTranslation, useEffect, vol, transcript, isListening, handleListing)src/MyComponents/About1.js- remove unusedleadimport, fix redundantrole="list"src/MyComponents/Catalogue.js- remove unusedCardandNavLinkimportssrc/MyComponents/Chart.js- convert named import to side-effect import for chart.js/autosrc/MyComponents/Contact.js- remove unusedimg_ximportsrc/MyComponents/EnglishCatalogue.js- remove unusedCardandNavLinkimportssrc/MyComponents/Header.js- remove unusednavbarOpen/setNavbarOpenstatesrc/MyComponents/MathCatalogue.js- remove unusedCardandNavLinkimportssrc/MyComponents/Ngoenroll.js- remove unusedNavLink, fix invalidhref="#", fixclass->classNamesrc/MyComponents/ScienceCatalogue.js- remove unusedCard,profile,evs,evs2,evspracsrc/MyComponents/Sidebarvideos.js- remove unusedHStackimportsrc/MyComponents/SubjectCards.js- remove unuseduseState,Link,toast,braille,handleClick,Toaster; fix img alt textsrc/MyComponents/Videos.js- remove unusedborder,useEffect,CardHeader,CardBody,CardFooter,Image,Divider,handleClicksrc/MyComponents/banner.js- fix invalidhref="#"→href="/ngoenroll"src/MyComponents/leaders.js- fix redundantrole="list"onulsrc/MyComponents/login.js- remove unusedHeader,LockClosedIcon; remove unusederrorMessagevars; fixuseEffectmissingnavigatedependencysrc/MyPages/Coursecat.js- remove unusedCatalogue,NavLink,Bannerimportssrc/MyPages/English.js- remove unusedNavLinkimportsrc/MyPages/Footer.js- remove unused icon imports,Link,NavLink; fix empty/missinghrefon anchorssrc/MyPages/Home.js- remove unusedNavLinkimportsrc/MyPages/Infor.js- remove unuseduseState,img,muteimports; removepausefrom destructuringsrc/MyPages/Math.js- remove unusedSubjectCards,NavLink,Bannerimportssrc/MyPages/Science.js- remove unusedSubjectCards,NavLink,Bannerimportssrc/MyPages/profile.js- remove unusedPaperClipIconimportsrc/firebase.js- remove unusedanalyticsvariable.npmrcwithlegacy-peer-deps=truefor peer dependency conflict resolution/buildto.gitignoreto exclude build artifacts🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.