Skip to content

feat(linter): enable useAwait and noFloatingPromises biome rules#98

Merged
zeevdr merged 2 commits into
mainfrom
feat/biome-strict-async-rules
May 25, 2026
Merged

feat(linter): enable useAwait and noFloatingPromises biome rules#98
zeevdr merged 2 commits into
mainfrom
feat/biome-strict-async-rules

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented May 25, 2026

Summary

  • Enables two Biome lint rules (suspicious/useAwait and nursery/noFloatingPromises) to enforce correct async/Promise handling across the SDK.
  • Removes unnecessary async modifiers from 11 methods in ConfigClient and ConfigWatcher that delegated directly to Promise-returning helpers without awaiting.
  • asyncDispose and stop now explicitly return Promise.resolve() to satisfy their Promise<void> signatures without the async wrapper.

Test plan

  • npx biome check src/ passes with zero diagnostics under the new rules
  • npx tsc --noEmit reports no type errors
  • npm test — all 225 tests pass

Closes #66

Adds two SDK-rigor lint rules to biome.json:
- suspicious/useAwait (error): async functions must contain an await expression
- nursery/noFloatingPromises (error): Promise-like statements must be handled

Fixes all 11 violations surfaced by useAwait. The affected methods in
ConfigClient (getAll, set, setNumber, setBool, setTime, setDuration,
setMany, setNull, setTyped, asyncDispose) and ConfigWatcher (stop) were
marked async but delegated directly to Promise-returning helpers without
awaiting, making the async modifier unnecessary. Removed async from each;
asyncDispose and stop now return Promise.resolve() explicitly to satisfy
their Promise<void> return types.

Also bumps the biome schema URL from 2.4.13 to 2.4.15.

Closes #66

Co-Authored-By: Claude <noreply@anthropic.com>
@zeevdr zeevdr added this to the Beta Readiness milestone May 25, 2026
@zeevdr zeevdr added size: S Quick win — a few hours or less priority: P2 Nice-to-have labels May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Biome's useAwait rule does not recognise `await using` as an await
expression, producing false positives in the two asyncDispose tests.
Add biome-ignore suppressions with an explanation.

Co-Authored-By: Claude <noreply@anthropic.com>
@zeevdr zeevdr merged commit d65cf65 into main May 25, 2026
12 checks passed
@zeevdr zeevdr deleted the feat/biome-strict-async-rules branch May 25, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P2 Nice-to-have size: S Quick win — a few hours or less

Projects

None yet

Development

Successfully merging this pull request may close these issues.

biome: enable noFloatingPromises / useAwait for SDK rigor

1 participant