Skip to content

chore: remove eslint warnings and cleanup unused variables#310

Merged
Aamod-Dev merged 1 commit into
niharika-mente:mainfrom
VaishnaviP-06:chore/lint-cleanup
Jun 22, 2026
Merged

chore: remove eslint warnings and cleanup unused variables#310
Aamod-Dev merged 1 commit into
niharika-mente:mainfrom
VaishnaviP-06:chore/lint-cleanup

Conversation

@VaishnaviP-06

Copy link
Copy Markdown
Contributor

Tech Debt: Minor Linting and React Hook Warnings

##Issue No. #171

What was wrong

A codebase scan identified a few minor linting and code hygiene issues across the frontend and backend. These issues did not affect functionality but produced unnecessary ESLint warnings and included one technically incorrect React usage.

Changes Made

Frontend

  • Removed the unnecessary await before checkInWishlist() inside the useEffect in ProductCard.jsx.
  • checkInWishlist() is a synchronous array lookup using .some(), so awaiting it was unnecessary and misleading.

Backend

  • Renamed unused catch variables in product.controller.js image-upload error handlers.
  • Renamed the unused catch variable in authMiddleware.js.
  • Renamed the unused next parameter to _next in errorMiddleware.js while preserving Express error-handler behavior.

Files Changed

  • FRONTEND/src/components/ui/ProductCard.jsx
  • BACKEND/controllers/product.controller.js
  • BACKEND/middleware/authMiddleware.js
  • BACKEND/middleware/errorMiddleware.js

Testing

  • Verified checkInWishlist() is called synchronously.
  • Verified wishlist functionality continues to work correctly.
  • Verified no behavioral changes to product creation, update, authentication, or error handling.
Screenshot 2026-06-18 223016 Screenshot 2026-06-18 224046 Screenshot 2026-06-18 224139

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

@VaishnaviP-06 is attempting to deploy a commit to the niharika-mente's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Aamod-Dev Aamod-Dev added sssoc 36 backend For changes related to the Express server, API routes, or MongoDB models frontend For any changes in the React UI, components, or Vite setup refactor Clean up the code, improve performance, or reorganize files without adding new features to the UI Hard labels Jun 20, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The searchProducts function has a broken try/catch structure. The try body is at wrong indentation and the braces don't align with the function scope, creating orphaned catch block.

Fix: Rebase and ensure proper brace matching in searchProducts.

@VaishnaviP-06

Copy link
Copy Markdown
Contributor Author

The searchProducts function has a broken try/catch structure. The try body is at wrong indentation and the braces don't align with the function scope, creating orphaned catch block.

Fix: Rebase and ensure proper brace matching in searchProducts.

Okay Noted!!

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Request Changes

  • getRelatedProducts references targetTags (undefined), should be targetTagsSet.
  • getProductBundle function body has broken structure — code appears as loose statements outside the function.
  • Title says lint cleanup but includes a massive controller refactor. Keep scope focused.

@Aamod-Dev

Copy link
Copy Markdown
Collaborator

Scope exceeds lint cleanup, bugs found

@Aamod-Dev Aamod-Dev closed this Jun 20, 2026
@Aamod-Dev Aamod-Dev reopened this Jun 20, 2026
@VaishnaviP-06

Copy link
Copy Markdown
Contributor Author

Scope exceeds lint cleanup, bugs found

okay i'll check again and do the changes

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, approved!

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Needs changes: There are merge conflicts. Please resolve them.

@VaishnaviP-06

Copy link
Copy Markdown
Contributor Author

Hi @aamod,
I've resolved the merge conflicts and pushed the updates from my side. Could you please take another look at the PR when you have time? Let know if there is any error left by chance.
Thanks!

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code fixes are solid: targetTagsSet bug fixed, bundle null safety added, proper Cloudinary cleanup on failure, consistent AppError pattern. LGTM.

@Aamod-Dev Aamod-Dev merged commit def5fc1 into niharika-mente:main Jun 22, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend For changes related to the Express server, API routes, or MongoDB models frontend For any changes in the React UI, components, or Vite setup Hard refactor Clean up the code, improve performance, or reorganize files without adding new features to the UI SSoC26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants