Skip to content

Fix: Resolve ESLint issues in UserIcon.tsx#396

Open
peynadol wants to merge 1 commit intolmcrean:mainfrom
peynadol:fix/usericon-eslint
Open

Fix: Resolve ESLint issues in UserIcon.tsx#396
peynadol wants to merge 1 commit intolmcrean:mainfrom
peynadol:fix/usericon-eslint

Conversation

@peynadol
Copy link

@peynadol peynadol commented Jul 1, 2025

Fixes #395

Description

This PR resolves ESLint issues in UserIcon.tsx:

  • Removed unused variable navigate
  • Added type="button" to all button elements
  • Confirmed zero remaining issues via npx eslint src/components/navbar/UserIcon.tsx

No visual or functional changes.

How to Test

  1. Pull this branch
  2. Run cd frontend && npm install
  3. Run npx eslint src/components/navbar/UserIcon.tsx
  4. Confirm there are no errors

Checklist

  • Pulled latest main branch
  • Ran npm run build to confirm no build errors
  • Ran npm run lint and fixed all issues
  • No UI changes required
  • Linked issue Fix ESLint Errors in UserIcon.tsx #395 using closing keywords

Additional Notes

While resolving the linting issues, I noticed a couple of areas that could be worth reviewing in the future:

  • There are several console.log() statements in UserIcon.tsx that appear to be for debugging these could be removed.
  • The component uses window.location.href for navigation, which works, but replacing it with useNavigate() from react-router-dom would avoid full page reloads and improve UX consistency within the SPA.

Happy to open a follow up issue or help with cleanup if useful!

This is my first open source PR, so i'm happy to make adjustments if needed.

@vercel
Copy link

vercel bot commented Jul 1, 2025

@peynadol is attempting to deploy a commit to the lmcrean's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@violaberg violaberg left a comment

Choose a reason for hiding this comment

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

I would add 'navigate' variable back and replace 'window.location.href' which would resolve ESlint error as well about unused variable. Otherwise well done and congrats on the first open source PR!

@peynadol
Copy link
Author

peynadol commented Jul 1, 2025

I would add 'navigate' variable back and replace 'window.location.href' which would resolve ESlint error as well about unused variable. Otherwise well done and congrats on the first open source PR!

Thanks! I noticed that navigate was originally present but wasn’t being used. I assumed it was replaced with window.location.href as a temporary workaround for the hard refresh issue mentioned elsewhere.

Appreciate the kind words. Definitely a bit nerve-wracking doing a first PR 😅

@lmcrean lmcrean added this to Pipeline Jul 5, 2025
@lmcrean lmcrean removed this from Pipeline Jul 5, 2025
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.

Fix ESLint Errors in UserIcon.tsx

2 participants