chore(types): fewer any casts; eslint ratchet 36 → 29 (#210) #439

Merged
jared merged 1 commits from chore/any-cleanup into lotus 2026-10-20 20:17:01 -04:00
Owner

Progress on #210 (typing hygiene). It doesn't close it: #210 is an ongoing notes issue.

  • Developer tools (send event, state event editor, room account data) and setMarkedUnread now go through the typed helpers in utils/room.ts and utils/accountData.ts, instead of casting at each call site. sendStateEvent accepts a developer-chosen type string, and setRoomAccountData is new, next to setAccountData.
  • SecretStorage passes the key as the SDK's SecretStorageKeyDescription.
  • CallEmbed replies with an IWidgetApiRequest.
  • fillMissingPowers writes through a Record instead of as any.

as any count: 15, down from 23 (both counts include the comment lines explaining the central casts). eslint warnings: 36 → 29, and the --max-warnings ratchet is tightened to 29.

What's left is deliberate or needs bigger work:

  • the central casts for custom event types the SDK's maps don't know (io.lotus.*, im.ponies.*);
  • the JS secretStorageKeys module;
  • poll-content parsing and Slate nodes in local search;
  • the room listener's generic handler.

Checks: all 1,405 unit tests pass; tsc and lint are clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Progress on #210 (typing hygiene). It doesn't close it: #210 is an ongoing notes issue. - **Developer tools** (send event, state event editor, room account data) and **`setMarkedUnread`** now go through the typed helpers in `utils/room.ts` and `utils/accountData.ts`, instead of casting at each call site. `sendStateEvent` accepts a developer-chosen type string, and `setRoomAccountData` is new, next to `setAccountData`. - `SecretStorage` passes the key as the SDK's `SecretStorageKeyDescription`. - `CallEmbed` replies with an `IWidgetApiRequest`. - `fillMissingPowers` writes through a `Record` instead of `as any`. `as any` count: 15, down from 23 (both counts include the comment lines explaining the central casts). eslint warnings: **36 → 29**, and the `--max-warnings` ratchet is tightened to 29. What's left is deliberate or needs bigger work: - the central casts for custom event types the SDK's maps don't know (`io.lotus.*`, `im.ponies.*`); - the JS `secretStorageKeys` module; - poll-content parsing and Slate nodes in local search; - the room listener's generic handler. Checks: all 1,405 unit tests pass; tsc and lint are clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-20 19:49:20 -04:00
chore(types): fewer any casts; eslint warning ratchet 36 -> 29 (#210)
CI / Build & Quality Checks (pull_request) Successful in 3m23s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 17s
CI / Playwright smoke (e2e) (pull_request) Successful in 18m6s
42040b6412
- Developer tools (send event, state event editor, room account data) and
  setMarkedUnread go through the typed helpers in utils/room and
  utils/accountData (new setRoomAccountData) instead of casting at the
  call site; sendStateEvent accepts a developer-chosen type string.
- SecretStorage passes the key description as the SDK's
  SecretStorageKeyDescription, CallEmbed replies with an IWidgetApiRequest,
  and fillMissingPowers writes through a Record instead of `as any`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit 8784a8158c into lotus 2026-10-20 20:17:01 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#439