Remove ESLint Disable Comments and as any Type Casts
Date: 2026-02-18 Command: pnpm lint / pnpm lint:fix
Summary
Removed widespread eslint-disable comments and (supabase as any) type casts across the codebase. After regenerating Supabase types (supabaseTypes.ts), the typed Supabase client now recognizes all tables, making as any workarounds unnecessary.
Issues Found
1. File-level eslint-disable blocks (removed)
Blanket disable comments suppressing multiple TypeScript rules:
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-argument */Files affected:
src/features/assets/services/assetsService.tssrc/features/flow-meter/services/databaseService.tssrc/features/flow-meter/services/flowMeterExportService.tssrc/features/flow-meter/services/tankAlertService.tssrc/features/flow-meter/services/tankService.tssrc/features/tank-alerts/components/SendEmailModal.tsxsrc/features/tank-alerts/services/tankAlertManagementService.tssrc/features/user-management/services/groupManagementService.tssrc/features/user-management/services/permissionService.tssrc/features/user-management/services/userManagementService.ts
2. Inline eslint-disable-next-line + (supabase as any) (removed)
Over 40 instances of:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const { data, error } = await (supabase as any).from("table_name")...Replaced with direct typed calls:
const { data, error } = await supabase.from("table_name")...Files affected: Same as above, plus:
src/features/flow-meter/services/databaseService.ts(calibration queries)
3. no-constant-binary-expression — dead code cleanup
File: src/app/(admin)/(pages)/flow-meter/index.tsx
Changed {false && (<JSX>)} pattern (which triggered eslint-disable-next-line no-constant-binary-expression) to a proper JSX comment block {/* ... */} for the hidden Overview Stats section.
4. Unnecessary async on non-awaiting functions
Removed async keyword from functions that return a Promise but don't use await:
Files affected:
src/features/dust-levels/services/compareExportService.ts—loadImageAsBase64src/features/dust-levels/services/exportService.ts—exportReportsrc/features/dust-ranger/services/dustRangerExportService.ts—exportReportsrc/features/email-schedules/services/variableTemplateService.ts—getAvailableVariablessrc/features/exports/services/basePdfExportService.ts—loadImageAsBase64src/features/exports/services/chartCapture.ts—captureChartElement,waitForChartRendersrc/features/flow-meter/services/flowMeterPdfExportService.ts—exportReportsrc/features/reports/hooks/useReportGenerator.tsx—generatePDFFromTemplatesrc/features/reports/services/pdfGenerationService.ts—loadImageAsBase64src/features/upload/services/csvParser.ts—parseFilesrc/features/upload/services/csvValidator.ts—parseCSVsrc/features/weekly-reports/hooks/useWeeklyReportAutoSave.ts—saveNowsrc/features/weekly-reports/services/weeklyReportService.ts—markAsCompleted
5. Outdated comments removed
Removed stale comments referencing "tables that may not yet exist in generated types" since types have been regenerated:
src/features/user-management/services/groupManagementService.tssrc/features/user-management/services/permissionService.tssrc/features/user-management/services/userManagementService.ts
6. Component/import rename to avoid shadowing
src/components/layouts/SideNav/Sidebar.tsx— RenamedMapimport toMapIconto avoid shadowing the globalMapconstructorsrc/app/(admin)/(dashboards)/index/components/CalibrationReminder.tsx— Renamed default export fromCalibrationRemindertoCalibrationReminderPanel(component name vs filename mismatch)
Root Cause
The Supabase TypeScript types (supabaseTypes.ts) were outdated and didn't include newer tables (user_groups, user_group_members, group_module_permissions, group_site_permissions, tank_level_alerts, ops_tank_corrections, cfg_tank_capacities, data_assets, etc.). Developers used (supabase as any) as a workaround, which required blanket ESLint disables. Regenerating types resolved the root issue.
Changes Made
- Removed ~15 file-level
eslint-disableblocks - Removed ~45 inline
eslint-disable-next-linecomments - Replaced ~45
(supabase as any)casts with directsupabasecalls - Removed
asyncfrom ~13 functions that don't await - Cleaned up dead code pattern in flow-meter page
- Renamed shadowed imports/exports
- Regenerated
src/lib/supabaseTypes.ts(816 lines changed, net -468 lines)