Skip to content

Conversation

@Patrick-Ehimen
Copy link

Replace namespace pattern with plain object exports to enable proper type inference for Biome's noFloatingPromises lint rule.

Before: export namespace Store { export import Entity = ... }
After: export const Store = { Entity: ... }

This fixes a linting blind spot where async Store method calls without await were not being detected, preventing bugs like the one in envio/airdrops/mappings/common/campaign/transfer-admin.ts:37

this fixes #252

Replace namespace pattern with plain object exports to enable proper
type inference for Biome's noFloatingPromises lint rule.

Before: export namespace Store { export import Entity = ... }
After: export const Store = { Entity: ... }

This fixes a linting blind spot where async Store method calls without
await were not being detected, preventing bugs like the one in
envio/airdrops/mappings/common/campaign/transfer-admin.ts:37.
@coderabbitai
Copy link

coderabbitai bot commented Jan 1, 2026

Walkthrough

Four Store index files across the envio package are refactored to replace exported namespaces with exported constant objects. The files modified are envio/airdrops/store/index.ts, envio/common/store/index.ts, envio/flow/store/index.ts, and envio/lockup/store/index.ts. Each change converts re-exported namespace members using the export import pattern to properties on plain object literals. The public API surface remains unchanged; consumers access exported entities the same way (Store.Entity), but the underlying implementation now uses value objects instead of type namespaces.

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor: convert Store namespace exports to object exports' clearly and concisely describes the main change across all modified files.
Description check ✅ Passed The description explains the rationale (enabling Biome's noFloatingPromises lint rule), shows before/after patterns, and references the specific issue being fixed.
Linked Issues check ✅ Passed The PR refactors all four specified Store index files (airdrops, common, flow, lockup) from namespace pattern to object exports, directly addressing the requirement in issue #252.
Out of Scope Changes check ✅ Passed All changes are limited to the four Store index files specified in issue #252, with each converting namespace exports to object exports as required.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd508b0 and 173c675.

📒 Files selected for processing (4)
  • envio/airdrops/store/index.ts
  • envio/common/store/index.ts
  • envio/flow/store/index.ts
  • envio/lockup/store/index.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,jsx,json,css,graphql}

📄 CodeRabbit inference engine (CLAUDE.md)

Run na biome lint <files> to lint JS/TS/JSON/CSS/GraphQL files after code generation

Files:

  • envio/flow/store/index.ts
  • envio/common/store/index.ts
  • envio/airdrops/store/index.ts
  • envio/lockup/store/index.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: sablier-labs/indexers PR: 0
File: envio/CLAUDE.md:0-0
Timestamp: 2025-11-27T11:27:47.428Z
Learning: Applies to envio/**/bindings.ts : Update `bindings.ts` to add/remove imports to match new GraphQL schema types
Learnt from: CR
Repo: sablier-labs/indexers PR: 0
File: contracts/CLAUDE.md:0-0
Timestamp: 2025-11-27T11:27:42.988Z
Learning: Applies to contracts/index.ts : index.ts should export convertToIndexed helper function to transform contracts from sablier package format to indexer format
Learnt from: CR
Repo: sablier-labs/indexers PR: 0
File: contracts/CLAUDE.md:0-0
Timestamp: 2025-11-27T11:27:42.988Z
Learning: Applies to contracts/index.ts : index.ts should export indexedContracts map aggregating contracts from all protocol files
Learnt from: CR
Repo: sablier-labs/indexers PR: 0
File: events/CLAUDE.md:0-0
Timestamp: 2025-11-27T11:28:20.015Z
Learning: Applies to events/**/{airdrops,flow,lockup}.ts : Each protocol file ({protocol}.ts) must export a `Types.EventMap` object with the structure `{ [contractName]: { [version]: Types.Event[] } }` containing event definitions per protocol (airdrops, flow, lockup)
📚 Learning: 2025-11-27T11:27:47.428Z
Learnt from: CR
Repo: sablier-labs/indexers PR: 0
File: envio/CLAUDE.md:0-0
Timestamp: 2025-11-27T11:27:47.428Z
Learning: Applies to envio/**/bindings.ts : Update `bindings.ts` to add/remove imports to match new GraphQL schema types

Applied to files:

  • envio/airdrops/store/index.ts
🧬 Code graph analysis (3)
envio/flow/store/index.ts (2)
envio/airdrops/store/index.ts (1)
  • Store (7-13)
envio/lockup/store/index.ts (1)
  • Store (5-9)
envio/airdrops/store/index.ts (2)
envio/flow/store/index.ts (1)
  • Store (5-9)
envio/lockup/store/index.ts (1)
  • Store (5-9)
envio/lockup/store/index.ts (2)
envio/airdrops/store/index.ts (1)
  • Store (7-13)
envio/flow/store/index.ts (1)
  • Store (5-9)
🔇 Additional comments (4)
envio/airdrops/store/index.ts (1)

7-13: LGTM! Conversion correctly applied.

The namespace-to-object export conversion is implemented correctly, exposing the same five entities (Action, Activity, Campaign, Factory, Watcher) as properties on the Store object. This change maintains the public API while enabling proper promise type inference.

envio/flow/store/index.ts (1)

5-9: LGTM! Refactor correctly applied.

The conversion from namespace to object export is correct and consistent with the pattern used in envio/lockup/store/index.ts. The public API is preserved while enabling proper type inference for promise detection.

envio/common/store/index.ts (1)

7-13: LGTM! CommonStore refactor correctly implemented.

The namespace-to-object conversion is correct, exposing five entities (Action, Asset, Contract, DeprecatedStream, Watcher) as properties on the CommonStore object. The separate export * as Contract on line 15 is preserved and does not conflict with CommonStore.Contract.

envio/lockup/store/index.ts (1)

5-9: LGTM! Namespace-to-object conversion correctly implemented.

The refactor from namespace export to object export is correctly implemented and consistently applied across all Store files (airdrops, flow, lockup, and common). All files follow the same object-based export pattern.

Note: Verification of Biome's noFloatingPromises rule behavior requires running na biome lint in your local environment, as it's not available in the verification sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@smol-ninja smol-ninja self-requested a review January 5, 2026 13:03
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.

Refactor Store namespace pattern to enable noFloatingPromises lint detection

1 participant