{{ theme.skipToContentLabel || 'Skip to content' }}

Biome Configuration and Ignore Comments

Date: 2026-02-18 Command: pnpm biome:check / pnpm biome:fix

Summary

Updated Biome configuration and added targeted biome-ignore comments for legitimate patterns that Biome's useComponentExportOnlyModules rule flags but are intentional design choices.

Configuration Changes

File: biome.json

1. Added google to JavaScript globals

json
"javascript": {
  "globals": ["google"]
}

Reason: The heatmap feature uses Google Maps API, which exposes a global google object. Without this, Biome reports it as an undefined reference.

2. Disabled noImplicitBoolean rule

json
"noImplicitBoolean": "off"  // was "error"

Reason: The codebase uses shorthand boolean props extensively (e.g., <Component disabled /> instead of <Component disabled={true} />). This is standard React convention and enforcing explicit booleans would require changes across hundreds of components with no practical benefit.

biome-ignore Comments Added

All for rule lint/style/useComponentExportOnlyModules — Biome flags non-component exports from files that also export React components. These are intentional co-located exports.

Co-located hook exports (from Context files)

  • src/context/useLayoutContext.tsxuseLayoutContext hook
  • src/contexts/AuthContext.tsxuseAuthContext hook

Co-located type/constant exports

  • src/features/dust-levels/components/ExportModal.tsxTimezoneOption type, TIMEZONE_OPTIONS constant, PdfOrientation type re-export
  • src/features/email-schedules/components/ComposeModal.tsxFormState type
  • src/components/ui/DateRangeSelector.tsxgetInitialDateRange helper function

Re-exports for convenience

  • src/components/ui/Popover.tsx — Radix UI primitive re-exports (Popover, PopoverTrigger, PopoverContent, PopoverAnchor)

Default export alongside named export

  • src/features/email-schedules/components/AttachmentConfig.tsx
  • src/features/email-schedules/components/FlowMeterEmailPreviewModal.tsx
  • src/features/tank-alerts/components/TankAlertManagement.tsx
  • src/features/user-management/components/PermissionGate.tsx

Formatting Changes

Biome auto-formatted the following files (import sorting, line wrapping, bracket alignment):

  • src/app/(admin)/(pages)/heatmap/index.tsx — Type cast formatting
  • src/features/geofences/components/GeofenceGroupList.tsx — Import order
  • src/features/geofences/components/GeofenceList.tsx — Import order
  • src/features/geofences/components/GeofenceMap.tsx — Type cast formatting, trailing blank line
  • src/features/geofences/hooks/useGeofences.ts — Import order (alphabetical)
  • src/features/geofences/services/geofenceService.ts — Import order
  • src/features/geofences/services/geofenceService.test.tsexpect() call formatting
  • src/features/geofences/utils.ts — Import order
  • src/features/geofences/utils.test.ts — Long string line wrapping
  • src/features/weekly-reports/services/weeklyReportService.test.ts — Constructor type formatting
  • Multiple service files — .upsert() / .insert() call chain formatting after removing (supabase as any)

Root Cause

The useComponentExportOnlyModules rule is designed to enforce single-responsibility in component files, but the project intentionally co-locates related types, hooks, and constants with their components for better developer experience. The biome-ignore comments document these as deliberate exceptions.