Skip to content

fix: resolve all 28 pre-existing frontend eslint errors#842

Open
Rudra-clrscr wants to merge 2 commits into
Userunknown84:mainfrom
Rudra-clrscr:fix/frontend-eslint-errors
Open

fix: resolve all 28 pre-existing frontend eslint errors#842
Rudra-clrscr wants to merge 2 commits into
Userunknown84:mainfrom
Rudra-clrscr:fix/frontend-eslint-errors

Conversation

@Rudra-clrscr

Copy link
Copy Markdown
Contributor
  • App.jsx: fix duplicate function App() declaration and unclosed try/catch left over from a bad merge, a missing closing , a call to an undefined analyzeEmojis (renamed to the real analyzeEmojiSentiment), invalid nested inside in the tab bar, a dead import of a nonexistent ./components/ResultBadge path, and add the missing 'u' regex flag on the emoji-matching pattern (without it, emoji were matched as split surrogate-pair halves instead of whole characters, silently breaking emoji-sentiment detection).
  • App.jsx: remove dead state/functions that were never wired to any UI (darkMode/showHistory/theme/showThemes shadowed by ThemeContext's isDark/themeMode/colorTheme; a streak/badge-popup gamification cluster; a scroll-to-top listener with no button; showCelebration with no consumer) and wire up the one half-built feature that had a real, matching component already imported: render using the existing showPatternLibrary state, the same way the DeSpamify modal is already wired.
  • ManipulationIndex.jsx: remove a stray non-JS line at the top of the file that broke parsing.
  • ActivityHeatmap.jsx: add the missing useEffect/api imports and the missing darkMode prop (used throughout the JSX but never destructured from props); remove unused startDate/endDate params.
  • EmailScannerDashboard.jsx: import the missing pythonApi client; remove an unused, never-called fetchUser function.
  • Dashboard.jsx: import and call useAuth() - user was referenced but never obtained from anywhere.
  • History.jsx (component + page), Chatbot.jsx, URLPreview.jsx: drop unused imports and unused catch-block bindings.
  • AuthContext.jsx, ThemeContext.jsx: add targeted eslint-disable comments for react-refresh/only-export-components on the colocated hook/constant exports (a standard, widely-used pattern; splitting into separate files would touch every import site across the app for no behavioral benefit).

The 4 remaining react-hooks/exhaustive-deps items are warnings, not errors - left alone since blindly adding the missing dependencies risks introducing render loops without individual review of each effect.

npx eslint . now reports 0 errors (previously 28) and vite build succeeds.

- App.jsx: fix duplicate `function App()` declaration and unclosed
  try/catch left over from a bad merge, a missing closing </div>, a call
  to an undefined analyzeEmojis (renamed to the real analyzeEmojiSentiment),
  invalid <button> nested inside <button> in the tab bar, a dead import of
  a nonexistent ./components/ResultBadge path, and add the missing 'u'
  regex flag on the emoji-matching pattern (without it, emoji were matched
  as split surrogate-pair halves instead of whole characters, silently
  breaking emoji-sentiment detection).
- App.jsx: remove dead state/functions that were never wired to any UI
  (darkMode/showHistory/theme/showThemes shadowed by ThemeContext's
  isDark/themeMode/colorTheme; a streak/badge-popup gamification cluster;
  a scroll-to-top listener with no button; showCelebration with no
  consumer) and wire up the one half-built feature that had a real,
  matching component already imported: render <SpamPatternLibrary> using
  the existing showPatternLibrary state, the same way the DeSpamify modal
  is already wired.
- ManipulationIndex.jsx: remove a stray non-JS line at the top of the file
  that broke parsing.
- ActivityHeatmap.jsx: add the missing useEffect/api imports and the
  missing `darkMode` prop (used throughout the JSX but never destructured
  from props); remove unused startDate/endDate params.
- EmailScannerDashboard.jsx: import the missing pythonApi client; remove
  an unused, never-called fetchUser function.
- Dashboard.jsx: import and call useAuth() - `user` was referenced but
  never obtained from anywhere.
- History.jsx (component + page), Chatbot.jsx, URLPreview.jsx: drop
  unused imports and unused catch-block bindings.
- AuthContext.jsx, ThemeContext.jsx: add targeted eslint-disable comments
  for react-refresh/only-export-components on the colocated hook/constant
  exports (a standard, widely-used pattern; splitting into separate files
  would touch every import site across the app for no behavioral benefit).

The 4 remaining react-hooks/exhaustive-deps items are warnings, not
errors - left alone since blindly adding the missing dependencies risks
introducing render loops without individual review of each effect.

`npx eslint .` now reports 0 errors (previously 28) and `vite build`
succeeds.
Copilot AI review requested due to automatic review settings July 13, 2026 19:52
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Aditya Sharma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Rudra-clrscr

Copy link
Copy Markdown
Contributor Author

@Userunknown84 this is an extra PR needed for solving CI issue

Copilot AI left a comment

Copy link
Copy Markdown

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 focuses on cleaning up pre-existing frontend ESLint errors and a few merge/parse issues, while also wiring up an existing UI feature (the Spam Pattern Library modal) so the app builds cleanly and runs without lint-blocking errors.

Changes:

  • Fix/cleanup in App.jsx: remove dead/invalid code paths, repair broken JSX/merge artifacts, correct component wiring (including SpamPatternLibrary), and address unused imports/vars.
  • Fix missing imports/props and parsing issues across components/pages (Dashboard, ActivityHeatmap, EmailScannerDashboard, History, Chatbot, URLPreview, ManipulationIndex).
  • Add targeted react-refresh/only-export-components disables for colocated exports in context providers.

Reviewed changes

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

Show a summary per file
File Description
frontend/src/pages/Dashboard.jsx Adds useAuth() to source user and pass user?.id into the heatmap.
frontend/src/pages/App.jsx Removes broken/unused code, fixes JSX issues, corrects emoji analysis call site, and wires SpamPatternLibrary.
frontend/src/context/ThemeContext.jsx Adds targeted eslint-disable for react-refresh on colocated exports.
frontend/src/context/AuthContext.jsx Adds targeted eslint-disable for react-refresh on colocated exports.
frontend/src/components/URLPreview.jsx Removes unused imports.
frontend/src/components/ManipulationIndex.jsx Removes a stray non-JS line that broke parsing.
frontend/src/components/History.jsx Removes unused imports and unused catch binding.
frontend/src/components/EmailScannerDashboard.jsx Imports pythonApi and removes unused, never-called user fetch.
frontend/src/components/Chatbot.jsx Removes unused catch binding.
frontend/src/components/ActivityHeatmap.jsx Adds missing imports and adds darkMode prop to match JSX usage.

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

if (!text) return { positive: 0, negative: 0, neutral: 0 };

const emojiRegex = /([\u2700-\u27BF]|[\uE000-\uF8FF]|[\uD83C-\uDBFF\uDC00-\uDFFF])/g;
const emojiRegex = /([\u2700-\u27BF]|[\uE000-\uF8FF]|[\uD83C-\uDBFF\uDC00-\uDFFF])/gu;
The container's Flask process defaults to FLASK_HOST=127.0.0.1 (a
deliberate secure default for bare-metal runs), so inside the CI
container it never listens on an interface reachable through the
-p 5000:5000 port mapping, and the smoke test's curl always times out.
docker-compose.yml already sets FLASK_HOST=0.0.0.0 for the same reason;
the CI workflow's docker run step needs the same override.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants