Skip to content

chore: fix all linting errors and enforce zero-warning policy for CI#667

Merged
CodeWithCJ merged 2 commits intoCodeWithCJ:mainfrom
Sim-sat:main
Feb 15, 2026
Merged

chore: fix all linting errors and enforce zero-warning policy for CI#667
CodeWithCJ merged 2 commits intoCodeWithCJ:mainfrom
Sim-sat:main

Conversation

@Sim-sat
Copy link
Contributor

@Sim-sat Sim-sat commented Feb 15, 2026

Description

  • We had about 600 eslint errors which made tracking them impossible. Almost all of them are coming from the use of any. I decided to suppress these errors for now and fix the 30 that were left. This means that while the old code needs improvement we atleast only merge code without new eslint errors. This makes future contributions more safe and improves overall code quality.
  • It also adds pre commit hooks using husky to check for linting, formatting and runs related tests

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Sim-sat, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the frontend's code quality and maintainability by systematically addressing a large volume of ESLint warnings. The primary focus was on managing the widespread use of the any type in TypeScript, ensuring that the codebase adheres to stricter linting standards. By enforcing a zero-warning policy in continuous integration, this change aims to prevent the reintroduction of similar issues and promote cleaner, more predictable code in future development.

Highlights

  • Linting Enforcement: The CI pipeline now enforces a zero-warning policy for ESLint, preventing new linting issues from being merged.
  • Any Type Suppression: Numerous instances of the any type in TypeScript have been explicitly suppressed using eslint-disable-next-line @typescript-eslint/no-explicit-any comments to resolve existing warnings.
  • React Hooks Linting: ESLint rules have been adjusted to suppress react-refresh/only-export-components for UI components and react-hooks/exhaustive-deps in several useEffect and useCallback hooks where dependencies are intentionally omitted or handled.
  • Code Cleanup: Redundant try...catch blocks around localStorage.setItem calls have been removed, and useId is now used for generating unique IDs in FastingTimerRing.tsx.
  • Exercise Type Refactoring: The Exercise type import has been refactored in several files, moving from exerciseService to exerciseSearchService for better type consistency.
  • Global Notification Icon Disabled: The GlobalNotificationIcon component has been temporarily disabled to always return null.
Changelog
  • SparkyFitnessFrontend/eslint.config.js
    • Added a new rule to disable react-refresh/only-export-components for UI components.
  • SparkyFitnessFrontend/package.json
    • Updated the lint script to enforce a zero-warning policy.
  • SparkyFitnessFrontend/src/App.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/api/Auth/auth.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/api/Foods/mealPlanTemplate.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/api/Foods/meals.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/api/Foods/nutrionix.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/api/Foods/usda.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/components/AppSetup.tsx
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/components/BarcodeScanner.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
    • Removed try...catch blocks around localStorage.setItem.
  • SparkyFitnessFrontend/src/components/DraggableChatbotButton.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/components/EnhancedCustomFoodForm.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/components/EnhancedFoodSearch.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/components/ExerciseActivityDetailsEditor.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/set-state-in-effect.
  • SparkyFitnessFrontend/src/components/FoodUnitSelector.tsx
    • Added eslint-disable-next-line comment for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/components/GitHubStarCounter.tsx
    • Added eslint-disable-next-line comment for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/components/GlobalNotificationIcon.tsx
    • Simplified the component to always return null, effectively disabling it.
  • SparkyFitnessFrontend/src/components/MealBuilder.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/components/MealPercentageManager.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/components/OidcCallback.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/components/Onboarding/OnBoarding.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps and any type usage.
  • SparkyFitnessFrontend/src/components/Onboarding/PersonalPlan.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/components/SparkyAIService.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/components/ui/textarea.tsx
    • Refactored TextareaProps to be inline with React.TextareaHTMLAttributes<HTMLTextAreaElement>.
  • SparkyFitnessFrontend/src/contexts/ActiveUserContext.tsx
    • Added eslint-disable-next-line comments for react-refresh/only-export-components, react-hooks/exhaustive-deps, and any type usage.
  • SparkyFitnessFrontend/src/contexts/ChatbotVisibilityContext.tsx
    • Added eslint-disable-next-line comment for react-refresh/only-export-components.
  • SparkyFitnessFrontend/src/contexts/FastingContext.tsx
    • Added eslint-disable-next-line comments for any type usage and react-refresh/only-export-components.
  • SparkyFitnessFrontend/src/contexts/PreferencesContext.tsx
    • Added eslint-disable-next-line comments for any type usage, react-refresh/only-export-components, and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/contexts/ThemeContext.tsx
    • Added eslint-disable-next-line comments for react-refresh/only-export-components and react-hooks/set-state-in-effect.
  • SparkyFitnessFrontend/src/contexts/WaterContainerContext.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps and react-refresh/only-export-components.
  • SparkyFitnessFrontend/src/hooks/Auth/useAuth.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/hooks/useAuth.tsx
    • Added eslint-disable-next-line comments for any type usage and react-refresh/only-export-components.
  • SparkyFitnessFrontend/src/lib/scannerEngines/Html5QrcodeEngine.ts
    • Removed try...catch block around this.html5QrCode.clear().
    • Updated errorMessage parameter to _errorMessage.
  • SparkyFitnessFrontend/src/lib/scannerEngines/QuaggaEngine.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/lib/scannerEngines/ZxingEngine.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/pages/Admin/BackupSettings.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Admin/BackupSettingsForm.tsx
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/pages/Admin/OidcProviderDialog.tsx
    • Added eslint-disable-next-line comments for react-hooks/set-state-in-effect.
  • SparkyFitnessFrontend/src/pages/Admin/OidcSettings.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Admin/UserManagement.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Auth/Auth.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Auth/ForgotPassword.tsx
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/pages/Auth/MagicLinkRequestDialog.tsx
    • Added eslint-disable-next-line comment for react-hooks/set-state-in-effect.
  • SparkyFitnessFrontend/src/pages/Auth/MfaChallenge.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Auth/ResetPassword.tsx
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/pages/Chat/SparkyChat.tsx
    • Added eslint-disable-next-line comment for react-hooks/set-state-in-effect.
  • SparkyFitnessFrontend/src/pages/Chat/SparkyChatInterface.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Chat/SparkyNutritionCoach.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/immutability.
  • SparkyFitnessFrontend/src/pages/CheckIn/CheckIn.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps and any type usage.
  • SparkyFitnessFrontend/src/pages/CheckIn/HomeDashboardFasting.tsx
    • Added eslint-disable-next-line comment for react-hooks/immutability.
  • SparkyFitnessFrontend/src/pages/CheckIn/SleepEntrySection.tsx
    • Added eslint-disable-next-line comment for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/CheckIn/SleepTimelineEditor.tsx
    • Added eslint-disable-next-line comments for react-hooks/set-state-in-effect.
  • SparkyFitnessFrontend/src/pages/Diary/ConvertToMealDialog.tsx
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/pages/Diary/CopyFoodEntryDialog.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Diary/DailyProgress.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps and any type usage.
    • Refactored netCalories to be a const.
  • SparkyFitnessFrontend/src/pages/Diary/Diary.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Diary/EditExerciseDatabaseDialog.tsx
    • Updated Exercise type import.
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Diary/EditExerciseEntryDialog.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Diary/EditFoodEntryDialog.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
    • Moved focusAndSelect to be a local function.
  • SparkyFitnessFrontend/src/pages/Diary/EditGoals.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps and any type usage.
  • SparkyFitnessFrontend/src/pages/Diary/EditMealFoodEntryDialog.tsx
    • Added eslint-disable-next-line comment for react-hooks/set-state-in-effect.
  • SparkyFitnessFrontend/src/pages/Diary/ExerciseCard.tsx
    • Updated Exercise type import.
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps and any type usage.
  • SparkyFitnessFrontend/src/pages/Diary/ExerciseEntryDisplay.tsx
    • Updated Exercise type import.
  • SparkyFitnessFrontend/src/pages/Diary/ExercisePlaybackModal.tsx
    • Updated Exercise type import.
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Diary/ExercisePresetEntryDisplay.tsx
    • Updated Exercise type import.
  • SparkyFitnessFrontend/src/pages/Diary/LogExerciseEntryDialog.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Diary/MiniNutritionTrends.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps, react-hooks/immutability, and any type usage.
  • SparkyFitnessFrontend/src/pages/Diary/WaterIntake.tsx
    • Added eslint-disable-next-line comment for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Exercises/AddExerciseDialog.tsx
    • Updated Exercise type import.
  • SparkyFitnessFrontend/src/pages/Exercises/AddWorkoutPlanDialog.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Exercises/ExerciseEntryHistoryImportCSV.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Exercises/ExerciseSearch.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Exercises/Exercises.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Exercises/WorkoutPlansManager.tsx
    • Changed component to a functional component.
    • Removed WorkoutPlansManagerProps type.
    • Added eslint-disable-next-line comment for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Exercises/WorkoutPresetForm.tsx
    • Removed Exercise type import from exerciseService.
    • Added Exercise type import from exerciseSearchService.
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Exercises/WorkoutPresetSelector.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Exercises/WorkoutPresetsManager.tsx
    • Changed component to a functional component.
    • Removed WorkoutPresetsManagerProps type.
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Fasting/EndFastDialog.tsx
    • Removed try...catch blocks around formatForLocalInput calls.
  • SparkyFitnessFrontend/src/pages/Fasting/FastingTimerRing.tsx
    • Replaced useMemo with useId for generating unique IDs.
  • SparkyFitnessFrontend/src/pages/Foods/MealPlanTemplateForm.tsx
    • Added eslint-disable-next-line comment for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Foods/MealUnitSelector.tsx
    • Added eslint-disable-next-line comment for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Goals/Goals.tsx
    • Added eslint-disable-next-line comments for react-hooks/exhaustive-deps and any type usage.
  • SparkyFitnessFrontend/src/pages/Integrations/FitbitCallback.tsx
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/pages/Integrations/PolarCallback.tsx
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/pages/Integrations/WithingsCallback.tsx
    • Added eslint-disable-next-line comment for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Reports/ActivityReportLapTable.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/immutability.
  • SparkyFitnessFrontend/src/pages/Reports/ActivityReportVisualizer.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Reports/BodyBatteryGauge.tsx
    • Added eslint-disable-next-line comment for react-refresh/only-export-components.
  • SparkyFitnessFrontend/src/pages/Reports/ExerciseReportsDashboard.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Reports/FastingReport.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Reports/MoodChart.tsx
    • Moved CustomTooltip component outside the main component.
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/pages/Reports/Reports.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Reports/ReportsTables.tsx
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/pages/Reports/SleepReport.tsx
    • Added eslint-disable-next-line comment for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Reports/SpO2Card.tsx
    • Added eslint-disable-next-line comment for react-hooks/set-state-in-effect.
  • SparkyFitnessFrontend/src/pages/Reports/SpO2Gauge.tsx
    • Added eslint-disable-next-line comments for react-refresh/only-export-components.
  • SparkyFitnessFrontend/src/pages/Reports/WorkoutReportVisualizer.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Settings/AIServiceSettings.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Settings/AddExternalProviderForm.tsx
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/pages/Settings/ExternalProviderList.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Settings/ExternalProviderSettings.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Settings/FamilyAccessManager.tsx
    • Added eslint-disable-next-line comment for react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Settings/GarminConnectSettings.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Settings/MFASettings.tsx
    • Changed component to a functional component.
    • Removed MFASettingsProps type.
    • Removed useAuth import.
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Settings/MealTypeManager.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Settings/NutrientDisplaySettings.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Settings/PasskeySettings.tsx
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/pages/Settings/SettingsPage.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/pages/Settings/WaterContainerManager.tsx
    • Added eslint-disable-next-line comments for any type usage and react-hooks/exhaustive-deps.
  • SparkyFitnessFrontend/src/services/Chatbot/Chatbot_ChatHandler.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/services/Chatbot/Chatbot_ExerciseHandler.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/Chatbot/Chatbot_FoodHandler.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/Chatbot/Chatbot_MeasurementHandler.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/Chatbot/Chatbot_types.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/services/Chatbot/Chatbot_utils.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/services/aiServiceSettingsService.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/api.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/checkInService.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/customCategoryService.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/customMeasurementService.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/dailyProgressService.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/services/exerciseEntryService.ts
    • Added eslint-disable-next-line comments for any type usage.
    • Removed else if (typeof value === 'object' && !Array.isArray(value)) block.
  • SparkyFitnessFrontend/src/services/exerciseSearchService.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/exerciseService.ts
    • Removed Exercise interface.
    • Updated Exercise import to exerciseSearchService.
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/services/familyAccessService.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/services/foodEntryService.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/freeExerciseDBSchemaService.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/services/mealTypeService.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/services/moodService.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/reportsService.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/services/sparkyChatService.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/services/workoutPresetService.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/tests/setupTests.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/types/goals.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/types/workout.ts
    • Updated Exercise import to exerciseSearchService.
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/utils/api.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/src/utils/chartUtils.ts
    • Added eslint-disable-next-line comment for any type usage.
  • SparkyFitnessFrontend/src/utils/logging.ts
    • Added eslint-disable-next-line comments for any type usage.
  • SparkyFitnessFrontend/tailwind.config.ts
    • Imported tailwindcssAnimate and used it in the plugins array.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci-tests.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a great step towards improving code quality by addressing a large number of linting errors and enforcing a zero-warning policy. The main approach of suppressing no-explicit-any and react-hooks/exhaustive-deps errors is a pragmatic way to establish a clean baseline. My review focuses on a few key areas where these suppressions might hide underlying issues or where a better fix is readily available. I've highlighted potential bugs related to React hooks dependencies, suggested type safety improvements, and pointed out a couple of other potential issues. Moving forward, it would be beneficial to create follow-up tasks to gradually address the suppressed any types by introducing proper typing, which will make the codebase more robust and maintainable.

Comment on lines 77 to 78
}, []);

Copy link
Contributor

Choose a reason for hiding this comment

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

high

Suppressing the exhaustive-deps rule can lead to bugs due to stale closures. This useEffect has an empty dependency array but uses maxY and setDefaultPosition from the component's scope. These functions should be included in the dependency array, and to prevent re-renders, they should be memoized with useCallback or useMemo.

This issue is present in multiple places in this file. Please address all instances to ensure the component behaves as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes of course but we can't fix 150 bugs at once

try {
await this.html5QrCode.clear();
} catch (e) {}
this.html5QrCode.clear();
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The clear() method on html5QrCode returns a Promise. By not await-ing it, you risk unhandled promise rejections if the operation fails. The original try...catch with await was safer. It's best to restore the await and handle potential errors.

      try {
        await this.html5QrCode.clear();
      } catch (e) {
        console.error('Error clearing html5-qrcode on start failure:', e);
      }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not true doesn't return a promise. using await here is wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Returns void

Comment on lines +74 to 78
// eslint-disable-next-line @typescript-eslint/no-explicit-any
message: string | ((...args: any[]) => string) | undefined,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...args: any[]
): string | undefined => {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While suppressing the no-explicit-any lint rule works, a better long-term solution is to use the unknown type for improved type safety. This avoids the need for eslint-disable and makes the function signature more robust.

  message: string | ((...args: unknown[]) => string) | undefined,
  ...args: unknown[]
): string | undefined => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cant fix 400 errors at once

Comment on lines +152 to +154

setEngineInstance(engine);
try {
localStorage.setItem('barcodeScannerEngine', selectedEngine);
} catch {}
localStorage.setItem('barcodeScannerEngine', selectedEngine);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Removing the try...catch block around localStorage.setItem could lead to unhandled exceptions if localStorage is unavailable (e.g., in private browsing mode, or if disabled by the user). It's safer to wrap this call in a try...catch and log any errors, rather than letting them crash the application or failing silently.

    try {
      localStorage.setItem('barcodeScannerEngine', selectedEngine);
    } catch (e) {
      console.warn('Failed to save barcodeScannerEngine to localStorage', e);
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the catch was empty so it no point in using it

Comment on lines +277 to 311
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(prefs as any).include_bmr_in_net_calories || false
);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const age = (userProfile as any)?.date_of_birth
? new Date().getFullYear() -
// eslint-disable-next-line @typescript-eslint/no-explicit-any
new Date((userProfile as any).date_of_birth).getFullYear()
: 0;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const gender = (userProfile as any)?.gender;

if (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(prefs as any).bmr_algorithm &&
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(mostRecentWeight as any)?.weight &&
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(mostRecentHeight as any)?.height &&
age &&
gender
) {
try {
const bmrValue = calculateBmr(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(prefs as any).bmr_algorithm as BmrAlgorithm,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(mostRecentWeight as any).weight,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(mostRecentHeight as any).height,
age,
gender,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(mostRecentBodyFat as any)?.body_fat_percentage
);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There are numerous as any type assertions in this block when accessing properties from prefs, userProfile, mostRecentWeight, etc. This undermines type safety and can hide potential bugs. It would be better to define proper interfaces for these objects (e.g., UserProfile, UserPreferences) and use them for type checking. This would make the code safer, more readable, and easier to maintain.

Comment on lines +83 to 85
// eslint-disable-next-line react-hooks/immutability
currentCumulativeDistance += lapDistance;
currentCumulativeDuration += lapDurationMinutes;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Mutating variables (currentCumulativeDistance, currentCumulativeDuration) inside a .map() function is a side effect that makes the code harder to understand and debug. The .map() function should ideally be pure. It's better to calculate these cumulative values in a separate step, for example, by using a forEach loop before mapping or by using reduce to build the new array with cumulative values.

@Sim-sat
Copy link
Contributor Author

Sim-sat commented Feb 15, 2026

Gemini doesn't understand the point of the pr...

@CodeWithCJ
Copy link
Owner

@Sim-sat
why lot of these notes. are they necessary? Many files didnt undergone any change except these new commented out lines

image

@Sim-sat
Copy link
Contributor Author

Sim-sat commented Feb 15, 2026

@CodeWithCJ Yes, they suppress the linting errors. They are a message to eslint. If you don't know eslint it's like a strict spellchecker. It's extremly strict and errors don't always mean something broken, just that's it's not the best way of doing something. However we should still strive to remove these in the future.

Fixing all 600 of them would take forever. Now we can run the check in the CI to at least prevent new errors from coming in. npm run lint now returns 0 errors and every new one is spotted instantly.

@CodeWithCJ
Copy link
Owner

CodeWithCJ commented Feb 15, 2026

Thanks. I thought the commented out is a section where the code doesn't get executed. I use that to disable a code or make some notes for me. didnt know about this. thats why I wondered why swagger api doc were all in commented out section.

@CodeWithCJ CodeWithCJ merged commit 03a3ae2 into CodeWithCJ:main Feb 15, 2026
6 checks passed
@Sim-sat
Copy link
Contributor Author

Sim-sat commented Feb 15, 2026

@CodeWithCJ Yes you have to get used to it. It's not really code thats getting executed, it's just a way to communicate with developments tool like swagger, eslint or prettier that have the goal to make development easier, but don't influence the code

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.

2 participants