@opsydyn/oxlint-effect 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -88,7 +88,7 @@ The [2.0.0 release](https://github.com/opsydyn/oxlint-effect/releases/tag/v2.0.0
88
88
  includes migration notes. Older 1.x packages do not export `effect3`; upgrade
89
89
  the plugin to 2.x to use the explicit legacy presets without upgrading Effect.
90
90
 
91
- `bun run test:effect-versions` verifies pinned packed Effect 3.21.4 and 4.0.0
91
+ `bun run test:effect-versions` verifies pinned packed Effect 3.22.1 and 4.0.0
92
92
  consumers, with exact warning counts, clean controls and config typechecks.
93
93
  All Q01-Q52 now have behavioural evidence in the matching packed consumers.
94
94
  The complete rule/group gate and unchanged 30 KB bundle-size gate pass locally.
@@ -633,21 +633,44 @@ export default defineConfig({
633
633
 
634
634
  ### Concurrency Safety
635
635
 
636
+ **Version scope:** plugin **2.2.0 and later** changes the three race/shared-state
637
+ rules below for both majors. Published 2.1.x retains the
638
+ previous policy. Rule IDs, group selection and preset membership are unchanged.
639
+ These three rules now resolve actual value imports: `Effect as Fx`, namespace
640
+ imports from `effect` / `effect/Effect`, and named subpath operations. Direct,
641
+ curried and terminal pipe forms are supported; shadowed and type-only bindings
642
+ are excluded. This does not claim alias support for every concurrency rule.
643
+
644
+ Race warnings require visible resource-shaped acquisition without a local
645
+ cleanup owner. Pure or opaque operands do not need dummy finalizers. Cleanup on
646
+ another branch does not own an acquisition. Collection mutation warnings require
647
+ an explicit literal budget above one, global `Infinity` or `"unbounded"`; omission
648
+ and `1` are sequential and clean. Later opaque spreads/computed keys, named
649
+ budgets and legacy `"inherit"` remain unknown, not proven safe. Same-file lexical
650
+ ownership excludes worker-local/shadowed bindings and unexecuted callbacks.
651
+
652
+ See paired [Effect 4 failures](examples/effect4-consumer/src/concurrency-accuracy.bad.ts)
653
+ and [clean controls](examples/effect4-consumer/src/concurrency-accuracy.good.ts), or
654
+ the [legacy failures](examples/effect3-consumer/src/concurrency-accuracy.bad.ts)
655
+ and [controls](examples/effect3-consumer/src/concurrency-accuracy.good.ts).
656
+ The packed harness checks exact diagnostics, ordered values, atomic updates,
657
+ first-success/first-completion semantics, and the existing loser-release contracts.
658
+
636
659
  | Rule | Catches | Why |
637
660
  | --- | --- | --- |
638
661
  | `linteffect/no-unbounded-effect-all` | Visible `"unbounded"` or `Infinity` concurrency on `Effect.all`, including stored/tuple inputs. | Omitted options are sequential and clean. Last explicit properties win; later opaque spreads/computed keys and named options are not resolved. Unknown budgets are not proof of safety. |
639
662
  | `linteffect/no-fire-and-forget-fork` | V4: discarded direct/curried `forkChild` / `forkDetach` constructors, yielded handles and terminal pipe operators, including startup options. Legacy: bare `Effect.fork` statements only. | Bare construction is lazy, not a launched fiber. Retain and join/await/interrupt executed handles; children follow parent lifetime, detached fibers do not. `forkScoped` / `forkIn` are excluded; stored aliases and nonterminal pipes are not inferred. |
640
663
  | `linteffect/no-fork-in-loop` | V4: `forkChild` / `forkDetach` in the own body of `for`, `for...of`, `for...in`, `while`, or `do...while`, including direct/curried/terminal-pipe startup forms. Legacy: broad nested `Effect.fork` traversal. | Retaining handles does not impose a collection budget; prefer bounded `Effect.all` / `Effect.forEach`. Scoped APIs remain excluded, which is not proof of bounded work. V4 skips nested function definitions. |
641
- | `linteffect/no-race-without-cleanup` | V4: direct/curried/terminal-pipe `race`, `raceAll`, `raceFirst` and `raceAllFirst` without visible cleanup markers in arguments or local enclosing wrappers, including recognised generators and `acquireUseRelease` use callbacks. Legacy: `race` / `raceAll` arguments only. | Races already interrupt losers; owned resources still need finalizers/scopes. Markers do not prove every branch releases. Preserve first-success versus first-completion semantics; named task/cleanup aliases are not resolved. |
664
+ | `linteffect/no-race-without-cleanup` | Visible resource-shaped acquisition in a race branch without a local cleanup owner. Both majors support direct/curried/terminal-pipe `race`, `raceAll`, `raceFirst`; v4 adds `raceAllFirst`. | Races interrupt losers, not manually acquired resources. Pure/opaque operands stay clean. A sibling's cleanup is not ownership. Resource names and scope/finalizer wrappers are heuristics, not release proof; stored bodies and cross-file owners are not inferred. |
642
665
  | `linteffect/no-unobserved-fiber` | V4: yielded `forkChild` / `forkDetach` handles without a same-binding `Fiber.join`, `await`, `interrupt`, reference pipe or direct return. Legacy: direct `Effect.fork` initializers matched by file-wide name. | V4 lexical references keep same-name/shadowed observations separate; lazy Effects and scoped APIs stay clean. Return transfers ownership, not a guarantee of later observation. Aliases/aggregate observers and arbitrary wrapped initializers are not inferred; reference presence does not prove execution. |
643
666
  | `linteffect/no-unbounded-concurrent-retry` | Visible `Effect.retry` inside `Effect.all` / `Effect.forEach` arguments with an explicit unbounded budget. | Prevents visible retry fan-out; sequential and finite budgets stay clean. Retry duration/count and opaque helpers are not inferred. Bound both concurrency and retry/backoff policy. |
644
667
  | `linteffect/no-blocking-call-in-effect` | Identifier calls ending in `Sync`, or literal `fs` / `crypto` / `zlib` members ending in `Sync`, inside `Effect.sync` / `gen`; v4 also recognises self-bound `gen` and direct/named generator `fn`. | Sync suffixes are a heuristic, not import/performance analysis. Use genuinely asynchronous APIs via v4 `callback` (legacy `async`) / `tryPromise`, or a worker for blocking work. A Promise wrapper does not offload it. V4 skips nested function definitions; legacy traversal is broad. |
645
668
  | `linteffect/no-promise-concurrency-in-effect` | Literal `Promise.all`, `allSettled`, `race`, or `any` inside `sync` / `gen` or recognised major-specific logic callbacks; v4 adds self-bound `gen` and direct/named generator `fn`. | Prefer bounded `Effect.all` / `forEach`, legacy `either` / v4 `result` for typed outcomes, `raceFirst` for first completion and `race` for first success. Underlying operations must observe cancellation signals. Defects/interruption and `AggregateError` require explicit semantics, not a mechanical swap. V4 skips nested definitions; aliases/computed calls are not inferred. |
646
- | `linteffect/no-shared-mutable-state-across-fibers` | Outer `let` / `var` scalar writes or known collection mutations in inline direct `all` / `forEach` work; v4 also checks direct/curried/terminal-pipe child/detached forks, using lexical binding identity. Legacy checks `fork` with file-wide name sets. | Use atomic `Ref.update` or immutable result aggregation. Worker-local/shadow parameters stay clean in v4. Syntax is not execution/data-race proof: constructors are lazy and default collections sequential. Stored task bodies, const containers and property writes are not inferred; the separate global-state rule has its own scope. |
669
+ | `linteffect/no-shared-mutable-state-across-fibers` | Captured scalar writes and known container mutations, including const containers, in inline explicitly parallel `all` / `forEach` work or legacy `fork` / current child-detached forks. Both majors use lexical identity. | Prefer atomic `Ref.update` or immutable aggregation. Sequential/opaque collections, local/shadow bindings and unused callbacks stay clean. Stored task bodies and object-property writes are not inferred; syntax is not execution/data-race proof. |
647
670
  | `linteffect/no-timeout-with-noninterruptible-promise` | V4: direct/curried/terminal-pipe `timeout`, `timeoutOption` or `timeoutOrElse` around literal `promise` / `tryPromise` adapters without callback parameters. Legacy: direct `timeout`, always flags `promise`, flags `tryPromise` without parameters. | Timeout interrupts the wrapper; the operation must honour its forwarded AbortSignal. Parameter presence is not cancellation proof, and named inputs/nonterminal pipes are not resolved. Legacy's signal-aware `promise` warning is retained despite that API supporting cooperative cancellation. Timeout failure is v4 `TimeoutError`, legacy `TimeoutException`. |
648
671
  | `linteffect/no-uninterruptible-concurrent-region` | V4: direct or terminal-pipe masking around inline collection, current child/detached/scoped/in forks, success/first-completion races or `Queue.take` / `PubSub.take`; traverses recognised gen/fn and logic callbacks, not ordinary nested definitions. Legacy: broad old fork/race/collection/Queue.take traversal. | Broad masking can defer cancellation until work finishes. Keep critical sections short and restore long-running work with `uninterruptibleMask`; restore reinstates ambient status, so use `interruptible` when overriding an already-masked caller is intended. Scoping alone does not restore interruption. Lazy syntax is not execution or child-mask proof; named bodies are not resolved. |
649
672
  | `linteffect/no-unbounded-queue-or-pubsub` | Explicit `Queue.unbounded` / `PubSub.unbounded`; v4 also detects `Queue.make` with omitted/undefined options or inline missing/undefined/Infinity capacity, and `PubSub.makeAtomicUnbounded`. | Use bounded suspend/backpressure constructors with an owned capacity. Named/spread options and computed capacities are not evaluated; clean syntax is not capacity validation. Dropping/sliding changes delivery semantics. V4 PubSub subscriptions use `PubSub.take`, legacy subscriptions use `Queue.take`; scope subscriptions and shut down owned buffers. |
650
- | `linteffect/no-global-mutable-concurrency-state` | V4: lexical module/global `let` / `var` writes or known mutable-container operations in inline collections and direct/curried/terminal-pipe child/detached forks. Legacy: file-wide names, including function-local declarations, and old fork syntax. | Own `Ref` state per execution/service or aggregate immutable results. V4 excludes local/shadow bindings; object-property writes and stored task bodies remain outside scope. Syntax is not execution/data-race proof; default collections are sequential. |
673
+ | `linteffect/no-global-mutable-concurrency-state` | Module/global scalar and container writes from inline explicitly parallel collections or supported forks, resolved by lexical binding in both majors. | Own atomic `Ref` state per service/execution or aggregate immutable results. Function-owned state is not global. Sequential/opaque collections and shadowed bindings stay clean; property writes, stored tasks and general execution safety are not inferred. |
651
674
  | `linteffect/no-yield-with-held-semaphore-permit` | V4: instance/namespace `Semaphore.withPermit` / `withPermits`, including curried/terminal pipes, around visible waits, Promise adapters or current concurrent work in recognised gen/fn bodies. Legacy: `Effect.Semaphore.withPermits` and direct/curried `TSemaphore` forms with broad traversal. | Strict-only coordination policy, not permit-leak detection. Narrow unrelated waits when semantics allow; async I/O may intentionally be permit-bound, and moving it outside changes concurrency limits. Named tasks, ordinary nested definitions in v4 and other acquisition APIs are not inferred. |
652
675
  | `linteffect/no-yield-with-held-mutable-ref` | Four effectful modifier names: `modifyEffect`, `modifySomeEffect`, `updateEffect`, `updateAndGetEffect`. V4: literal `SynchronizedRef` / `SubscriptionRef` namespaces, direct/curried/terminal-pipe forms and visible waits/current concurrent work through recognised gen/fn callbacks. Legacy: namespace/instance forms with broad traversal. | Strict-only short critical-section policy. Move only independent work outside, retaining a synchronous state transition; splitting state-dependent I/O can lose atomicity. V4 skips ordinary unused helpers, named callback bodies and unrelated object methods. Other modifier names remain outside this rule. |
653
676
  | `linteffect/no-unscoped-background-fiber` | V4: direct/curried/terminal-pipe `forkDetach`, including returned/joined handles and a scope inside the detached child. Empty/undefined/inline-options factories stay clean. Legacy: direct `forkDaemon` without a visible `supervised` marker in child work. | Strict-only scoped-lifetime policy: use `forkScoped` / `forkIn` or child ownership. Joining/returning observes or transfers a handle, not scoped teardown. Legacy supervision observes but does not itself interrupt; v4 removed `Effect.supervised`. Intentional detached ownership still warns; stored factory aliases/named options are not inferred. |