fix: resolve all 28 pre-existing frontend eslint errors#842
Open
Rudra-clrscr wants to merge 2 commits into
Open
fix: resolve all 28 pre-existing frontend eslint errors#842Rudra-clrscr wants to merge 2 commits into
Rudra-clrscr wants to merge 2 commits into
Conversation
- 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.
|
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. |
Contributor
Author
|
@Userunknown84 this is an extra PR needed for solving CI issue |
There was a problem hiding this comment.
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 (includingSpamPatternLibrary), 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-componentsdisables 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).darkModeprop (used throughout the JSX but never destructured from props); remove unused startDate/endDate params.userwas referenced but never obtained from anywhere.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) andvite buildsucceeds.