Skip to content

chore: Mirror the EventSourcingDB Biome configuration and resolve lint violations#377

Merged
goloroden merged 3 commits into
mainfrom
mirror-biome-config-and-portable-event-crypto
Jun 27, 2026
Merged

chore: Mirror the EventSourcingDB Biome configuration and resolve lint violations#377
goloroden merged 3 commits into
mainfrom
mirror-biome-config-and-portable-event-crypto

Conversation

@goloroden

@goloroden goloroden commented Jun 27, 2026

Copy link
Copy Markdown
Member

What & why

Align the JavaScript client's Biome (and TypeScript) setup with the EventSourcingDB and resolve the resulting lint violations. Builds on the Biome 2.5.0 bump (#375), which it includes and supersedes.

Changes

  • Adopt the stricter Biome ruleset used by the EventSourcingDB UI: preset: "all", nursery: "on", file-naming convention, test overrides.
  • Resolve all resulting errors and warnings: explicit types in Client.ts and the stream type guards, bounded loops in readNdJsonStream, a renamed shadowed variable, plus safe/unsafe auto-fixes.
  • This client targets Node.js, so noNodejsModules is disabled (it only adds value for runtime-agnostic code); the node: built-ins (crypto/fs/path) are used directly.
  • Align the TypeScript type-check with the bundled output: tsdown emits dual ESM + CJS, so module is set to esnext / moduleResolution: bundler (was CommonJS). The Dockerfile helper now uses import.meta.dirname, which satisfies noGlobalDirnameFilename directly (no inline ignore). Existing sources type-check unchanged.

Scope

Config + lint only, no functional or runtime change to the published API. The Event cryptography keeps using node:crypto (this client targets Node.js).

Verification

  • npm run analyze (tsc + Biome --error-on-warnings): green — 0 errors, 0 warnings.
  • Event.test.ts (hash + signature, against the real ESDB image): 6/6 green — also confirms import.meta.dirname resolves at runtime.
  • readNdJsonStream.test.ts: green.

Closes #375.

🤖 Generated with Claude Code

https://claude.ai/code/session_015sN371FTWrWsz6k3qk3oPw

Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 2.4.16 to 2.5.0.
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.5.0/packages/@biomejs/biome)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-version: 2.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@goloroden goloroden requested a review from a team as a code owner June 27, 2026 00:18
@goloroden goloroden force-pushed the mirror-biome-config-and-portable-event-crypto branch 2 times, most recently from 8261e68 to bf60ac9 Compare June 27, 2026 08:33
@goloroden goloroden changed the title feat!: Make Event hashing and signature verification runtime-portable. chore: Mirror the EventSourcingDB Biome configuration and resolve lint violations. Jun 27, 2026
@goloroden goloroden changed the title chore: Mirror the EventSourcingDB Biome configuration and resolve lint violations. chore: Mirror the EventSourcingDB Biome configuration and resolve lint violations Jun 27, 2026
…t violations.

Adopt the stricter Biome ruleset used by the EventSourcingDB UI (preset "all",
nursery on, file-naming convention) and resolve all resulting errors and
warnings: add explicit types in Client.ts and the stream type guards, refactor
the unbounded loops in readNdJsonStream into bounded conditions, and rename a
shadowed variable.

This client targets Node.js, so noNodejsModules is disabled (it only adds value
for runtime-agnostic code) and node:crypto/fs/path are used directly. The
Dockerfile helper keeps __dirname (it is compiled as CommonJS) instead of the
import.meta rewrite a Biome auto-fix had introduced, with an inline biome-ignore
for noGlobalDirnameFilename.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015sN371FTWrWsz6k3qk3oPw
@goloroden goloroden force-pushed the mirror-biome-config-and-portable-event-crypto branch from bf60ac9 to 159c06b Compare June 27, 2026 08:47
The package is bundled by tsdown into dual ESM + CommonJS (dist/index.mjs and
index.cjs), but tsc type-checked the sources as CommonJS (module "CommonJS"),
which rejected import.meta and forced __dirname. Switch the type-check to module
"esnext" with moduleResolution "bundler", matching the bundled reality; the
existing sources type-check unchanged.

getImageVersionFromDockerfile now uses import.meta.dirname instead of __dirname,
so noGlobalDirnameFilename is satisfied directly and its inline biome-ignore is
gone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015sN371FTWrWsz6k3qk3oPw
@goloroden goloroden merged commit 3220438 into main Jun 27, 2026
2 of 3 checks passed
@goloroden goloroden deleted the mirror-biome-config-and-portable-event-crypto branch June 27, 2026 09:09
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