Skip to content

feat: Add ESLint and Oxlint plugin#5

Merged
eersnington merged 1 commit into
mainfrom
feat/lint-plugin
Jul 8, 2026
Merged

feat: Add ESLint and Oxlint plugin#5
eersnington merged 1 commit into
mainfrom
feat/lint-plugin

Conversation

@eersnington

@eersnington eersnington commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Why

Workflows fail in ways TypeScript will not catch. A step promise can be created but never awaited. A replay input can be mutated. A Promise.race can make replay behavior depend on timing. A random step name can break persisted step reuse. This PR adds lint rules for those workflow-specific footguns.
What

Adds a new package, @sideffect/lint, with ESLint and Oxlint support.

It ships five rules based on Cloudflare's Guidelines

  • await-step-calls: step calls must be awaited, returned, yielded, chained, or collected by an awaited aggregate.
  • no-event-mutation: workflow event and payload values are treated as replay inputs and cannot be mutated.
  • no-step-race-any-outside-step: Promise.race / Promise.any over steps must happen inside a step.do.
  • deterministic-step-names: step names cannot be built from obvious time/random sources.
  • max-step-timeout-30m: step.do timeouts over 30 minutes are reported.

It also adds presets, tests, docs, package exports, and publish workflow support for the new package.

How

The plugin parses workflow syntax and only applies the rules inside recognized workflow bodies.

It recognizes:

  • native Cloudflare WorkflowEntrypoint classes
  • Sideffect Workflow.make(...).toLayer(...)
  • local/exported workflow constants
  • simple imported workflow definitions
  • Effect layer bodies where step promises are owned through Effect.promise or Effect.tryPromise

The repo then wires the new Oxlint plugin into the root Vite+ lint config so the same rules dogfood against this codebase.

@eersnington eersnington marked this pull request as draft July 3, 2026 15:34
@eersnington eersnington force-pushed the feat/lint-plugin branch 3 times, most recently from c16f177 to 4a1964f Compare July 3, 2026 23:52
@eersnington eersnington marked this pull request as ready for review July 3, 2026 23:55
@eersnington eersnington force-pushed the feat/lint-plugin branch 4 times, most recently from 4e0369d to 7351065 Compare July 8, 2026 13:07
@eersnington eersnington merged commit 6a48a62 into main Jul 8, 2026
3 checks passed
@eersnington eersnington deleted the feat/lint-plugin branch July 8, 2026 13:59
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