Skip to content

fix: drop redundant named export on service singletons - #15

Merged
HenryCordes merged 1 commit into
mainfrom
fix/duplicate-service-named-export
Jul 2, 2026
Merged

fix: drop redundant named export on service singletons#15
HenryCordes merged 1 commit into
mainfrom
fix/duplicate-service-named-export

Conversation

@HenryCordes

Copy link
Copy Markdown
Owner

Summary

  • Every src/api/services/*.ts module exported its singleton both as a named export (export const xService = ...) and as the default export, while every consumer (hooks, screens, tests) imported it as default. eslint-plugin-import's import/no-named-as-default flagged this as an ambiguity risk at every one of the ~20 import sites (30 warnings total).
  • Nothing in the codebase actually consumes the named export (verified before making this change), so the fix is at the source: drop export from the singleton declaration in each of the 10 service files, keeping only the default export. No import site changes needed.

Test plan

  • npx expo lint --no-cache — the 30 import/no-named-as-default warnings for these services are gone (57 → 21 remaining warnings, all unrelated)
  • npm run typecheck — clean
  • npm test — 610/610 passing

Note: this branch is based on main, which still has the 4 pre-existing react-hooks/set-state-in-effect lint errors also visible in npx expo lint output — those are already fixed on the separate, still-open PR #14 and out of scope here.

Each service module exported its singleton both as a named export and
as the default export, and every consumer imported the default -
eslint-plugin-import flagged the unused named export as an
import/no-named-as-default ambiguity risk on every import site (30
warnings across hooks, screens, and tests). No file actually consumed
the named export, so dropping it resolves the warning at the source
instead of at each of the ~20 call sites.
@HenryCordes
HenryCordes merged commit ca693e8 into main Jul 2, 2026
1 check passed
@HenryCordes
HenryCordes deleted the fix/duplicate-service-named-export branch July 2, 2026 17:21
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