Skip to content

feat: enable typed ESLint rules (@typescript-eslint/recommended + stylistic) - #105

Merged
cybermax4200 merged 4 commits into
ecotask-network:mainfrom
xJeffx23:feat/typescript-eslint-strict-rules
Aug 22, 2026
Merged

feat: enable typed ESLint rules (@typescript-eslint/recommended + stylistic)#105
cybermax4200 merged 4 commits into
ecotask-network:mainfrom
xJeffx23:feat/typescript-eslint-strict-rules

Conversation

@xJeffx23

Copy link
Copy Markdown
Contributor

Description

.eslintrc.js only extended @react-native, which has no @typescript-eslint/*
rules — unchecked promise rejections, unsafe boolean coercions, and other
TypeScript-specific anti-patterns were invisible to the linter.

This PR adds plugin:@typescript-eslint/recommended and
plugin:@typescript-eslint/stylistic to extends, plus enables
no-floating-promises, no-misused-promises, await-thenable, and
strict-boolean-expressions (all as warn) with type-aware parsing
(parserOptions.project). Fixed every resulting lint error across 42 files —
no // eslint-disable suppressions, no remaining any in src/.

Along the way, diagnosed and fixed an environment bug where
eslint-plugin-prettier hung indefinitely under type-aware linting because
prettier was never actually installed as a dependency, despite
eslint-plugin-prettier requiring it at runtime.

Removing any and turning on type checking also surfaced a few real,
pre-existing bugs, which are fixed here too:

  • notifee API calls used the wrong import shape (the module namespace
    instead of its default export), so displayNotification/cancelNotification
    silently never worked.
  • prefsStore's onRehydrateStorage callback was triple-nested by mistake,
    so the notification-preferences merge logic never ran on app rehydration.
  • useProofSubmit's submit() was called with mismatched arguments in
    SubmitProofScreen, silently dropping capturedAt and shifting lat/lng
    into the wrong parameters.

Closes #93

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that breaks existing functionality)
  • Documentation update
  • Chore (deps, tooling, refactoring)

How Has This Been Tested?

  • Unit tests added / updated
  • Integration tests added / updated
  • Manual testing on Android
  • Manual testing on iOS

npm run lint and npx eslint src/ (CI's exact lint command) both exit 0
with no errors. npm test passes 159/159 existing tests unchanged, including
the suites touched by this PR (useProofSubmit, authRefresh,
notifications, prefsStore, useTaskFeed). No behavior change was observed
in any passing test after the refactors.

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented on complex or non-obvious code
  • I have updated the documentation where needed
  • My changes generate no new warnings or lint errors
  • All existing and new tests pass

Screenshots

N/A — tooling/lint-only change, no UI impact.

Additional Context

Out of scope per the issue: no changes to .prettierrc.js and no import-ordering
rules were added. CI already runs npx eslint src/ on every push/PR
(.github/workflows/ci.yml), so no workflow changes were needed to enforce
this in CI.

Jefferson Calderon Mesen and others added 3 commits August 20, 2026 17:08
Jefferson Calderon Mesen Jefferson Calderon Mesen
(
feat: enable typed ESLint rules (@typescript-eslint/recommended + stylistic)
Resolves 21 conflicting files where upstream had independently landed
overlapping work (navigation typing, deep linking, Lobstr/Firebase
integration, network-status awareness, stricter TS compiler flags) while
this branch was adding typed ESLint rules across the codebase.

Resolution approach: prefer upstream's implementation wherever it
superseded or duplicated this branch's fix (e.g. its shared
navigation-typing module in src/navigation/types.ts + useAppNavigation.ts
replaces the per-screen CompositeNavigationProp boilerplate this branch
had written), then re-applied this branch's no-explicit-any /
no-floating-promises fixes on top where upstream's own code still had
them.

Two real bugs surfaced and fixed during resolution:
- eslint --fix had silently flipped src/navigation/types.ts's ParamList
  `type` aliases to `interface`, which don't satisfy react-navigation's
  ParamListBase constraint (no implicit index signature) — reverted to
  `type` and widened the lint-config exception from *.tsx to *.ts/*.tsx
  in that directory so it can't happen again.
- Two test files both named `useTaskFeed.test.ts(x)` in the same
  directory: TypeScript's project file discovery silently drops the
  `.tsx` one when a `.ts` file shares its base name, so upstream's newer
  suite was invisible to tsc/eslint entirely (pre-existing on
  upstream/main too). Renamed to useTaskFeedRefetch.test.tsx; both suites
  now run and type-check.

npm run lint, npx eslint src/ (CI's command), npx tsc --noEmit, and
npm test all pass cleanly (0 errors, 291/291 tests).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LV59Ymw7Yoh27FHdEcFn6z

@cybermax4200 cybermax4200 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The ci checks are failing please kindly fix them

…int-strict-rules

# Conflicts:
#	package-lock.json
#	package.json
#	src/hooks/useProofStatus.ts
@xJeffx23
xJeffx23 requested a review from cybermax4200 August 22, 2026 04:04

@cybermax4200 cybermax4200 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work!

@cybermax4200
cybermax4200 merged commit 3d2ac9b into ecotask-network:main Aug 22, 2026
4 checks passed
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.

[Tooling] ESLint config has no TypeScript-specific rules — no-floating-promises, strict-boolean-expressions are missing

2 participants