Skip to content

fix: resolve all lint warnings and promote warn rules to error#287

Merged
fiddur merged 2 commits intodevelopfrom
fix/lint-warnings-to-errors
Mar 1, 2026
Merged

fix: resolve all lint warnings and promote warn rules to error#287
fiddur merged 2 commits intodevelopfrom
fix/lint-warnings-to-errors

Conversation

@fiddur
Copy link
Owner

@fiddur fiddur commented Mar 1, 2026

Summary

  • Fix all ESLint warnings across backend and frontend, then promote the five warn-level rules (complexity, max-depth, max-lines, no-shadow, object-shorthand) to error in eslint.config.js so new violations fail CI.

Backend changes

  • oura-sync.ts: Extract data processing functions into new oura-process.ts to fix max-lines (540→~50 lines remaining)
  • mutations.ts: Extract notes, restore, and custom-metrics services into dedicated files to fix max-lines (596→~200 lines)
  • queries.ts: Extract enrichActivity() and enrichSleepFields() helpers to fix complexity (16→under 15)
  • mutations.ts addMetric: Extract validateCustomMetricRange() helper to fix complexity (16→under 15)

Frontend changes

  • Header.tsx: Data-driven NAV_LINKS array with NavLink component (complexity 18→under 15)
  • DayView: Extract drawPointMarker() and drawBlockOverlay() helpers (complexity 23→under 15)
  • DataSources: Extract shared SaveStatusIndicator, StatusBanner, DataTypesList, LoginRequired into shared.tsx; refactor CalendarsSource, LastFmSource, RescueTimeSource
  • EntityDetail: Split monolithic EntityContent into ActivityContent, TagContent, ProductivityContent, MetricContent; extract MetricDetail.tsx, ProductivityDetail.tsx, TagDetail.tsx
  • ExerciseDetail: Extract ExerciseStats component (complexity 20→under 15)
  • TagMappingsSettings: Extract RowStatusIndicator, IconPreview components (complexity 21→under 15)
  • LastFmTagRulesSettings: Extract AddRuleForm into separate file, RuleEditForm component, buildUpdateBody/getArtistUpdates helpers (complexity 18,17→under 15; max-lines 671→443+262)

ESLint config

All five rules promoted from warn to error:

complexity: ['error', 15]
'max-depth': ['error', 4]
'max-lines': ['error', { max: 500, skipBlankLines: true, skipComments: true }]
'no-shadow': 'error'
'object-shorthand': 'error'

Verification

  • pnpm fix — clean (zero warnings/errors)
  • pnpm check — clean (tsc + eslint pass)
  • Backend tests: 972/972 pass across 53 test files

Fix all ESLint warnings (complexity, max-lines, no-shadow, object-shorthand)
across backend and frontend, then promote the five warn-level rules to error
in eslint.config.js so new violations fail CI.

Backend:
- Extract Oura data processing into oura-process.ts (max-lines fix)
- Extract notes, restore, custom-metrics services from mutations.ts
- Extract enrichActivity/enrichSleepFields helpers in queries.ts

Frontend:
- Data-driven nav links in Header.tsx
- Extract shared DataSource components (shared.tsx)
- Split EntityDetail into type-specific components
- Extract RuleEditForm and AddRuleForm in LastFmTagRulesSettings
- Extract helpers in DayView, TagMappingsSettings, ExerciseDetail

All 972 backend tests pass. pnpm check and pnpm fix clean.
@codecov
Copy link

codecov bot commented Mar 1, 2026

Codecov Report

❌ Patch coverage is 84.57249% with 83 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.43%. Comparing base (a2c37e5) to head (7e5dee5).
⚠️ Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
apps/backend/src/services/notes.ts 2.00% 49 Missing ⚠️
apps/backend/src/services/restore.ts 4.76% 20 Missing ⚠️
apps/backend/src/services/queries.ts 67.44% 14 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #287      +/-   ##
===========================================
+ Coverage    31.88%   32.43%   +0.54%     
===========================================
  Files          181      185       +4     
  Lines        22992    22651     -341     
  Branches      1886     1889       +3     
===========================================
+ Hits          7331     7346      +15     
+ Misses       15627    15271     -356     
  Partials        34       34              
Flag Coverage Δ
backend 58.97% <84.57%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fiddur fiddur marked this pull request as ready for review March 1, 2026 08:37
@fiddur fiddur enabled auto-merge March 1, 2026 08:37
@fiddur fiddur merged commit 2c420cd into develop Mar 1, 2026
6 checks passed
@fiddur fiddur deleted the fix/lint-warnings-to-errors branch March 1, 2026 08:38
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.

1 participant