@opsydyn/oxlint-effect 2.1.0 → 2.3.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 +100 -13
- package/dist/index.d.mts +54 -0
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/skills/oxlint-effect/SKILL.md +7 -0
- package/skills/oxlint-effect/assets/cause-narrowing.bad.ts +31 -0
- package/skills/oxlint-effect/assets/cause-narrowing.contracts.ts +43 -0
- package/skills/oxlint-effect/assets/cause-narrowing.good.ts +32 -0
- package/skills/oxlint-effect/assets/cause-narrowing.types.ts +17 -0
- package/skills/oxlint-effect/assets/contracts.ts +1 -0
- package/skills/oxlint-effect/assets/effect4/cause-narrowing.bad.ts +31 -0
- package/skills/oxlint-effect/assets/effect4/cause-narrowing.contracts.ts +43 -0
- package/skills/oxlint-effect/assets/effect4/cause-narrowing.good.ts +32 -0
- package/skills/oxlint-effect/assets/effect4/cause-narrowing.types.ts +17 -0
- package/skills/oxlint-effect/assets/effect4/contracts.ts +1 -0
- package/skills/oxlint-effect/assets/effect4/error-preservation.bad.ts +1 -0
- package/skills/oxlint-effect/assets/error-preservation.bad.ts +1 -0
- package/skills/oxlint-effect/references/cause-narrowing.md +103 -0
- package/skills/oxlint-effect/references/configuration.md +7 -1
- package/skills/oxlint-effect/references/error-preservation.md +11 -3
- package/skills/oxlint-effect/references/versioned-rules.md +34 -0
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ installs from npm and checks annotated failures alongside clean repairs.
|
|
|
53
53
|
|
|
54
54
|
**Version scope:** these changes apply to plugin **2.1.0 and later**. Version
|
|
55
55
|
**2.0.x** retains the previous recommended bans and option-presence concurrency
|
|
56
|
-
checks.
|
|
56
|
+
checks.
|
|
57
57
|
|
|
58
58
|
`recommended` and `effect3.recommended` allow generator-based `Effect.fn`,
|
|
59
59
|
explicit `Effect.Effect`/`Layer.Layer` annotations and named Effect type aliases.
|
|
@@ -78,9 +78,9 @@ automatic span name. Throwing inside Effect.fn remains a typed-failure warning;
|
|
|
78
78
|
supporting the function form does not permit unsafe bodies.
|
|
79
79
|
|
|
80
80
|
Published `2.0.0` makes default exports Effect 4 policy and adds `effect3` for
|
|
81
|
-
legacy projects.
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
legacy projects. Version `2.3.0` adds one opt-in rule, for 147 registered rules
|
|
82
|
+
and 18 groups, qualified for their documented forms against the pinned majors:
|
|
83
|
+
147 legacy Effect 3 cases and 142 current Effect 4 cases, with five legacy-only policies.
|
|
84
84
|
Published 1.x packages retain their original Effect 3 behaviour and do not
|
|
85
85
|
provide the new namespace. See the [compatibility roadmap](roadmap/14-effect4-compatibility/README.md)
|
|
86
86
|
and [per-rule audit](docs/effect-version-inventory.json) for detection scope.
|
|
@@ -88,10 +88,13 @@ 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.
|
|
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
|
-
The
|
|
94
|
+
The original compatibility release used a 30 KB runtime cap. Version 2.3.0
|
|
95
|
+
uses an explicitly reviewed 31 KB cap for the cause-loss addition; see
|
|
96
|
+
[ADR 0004](docs/adr/0004-opt-in-cause-loss-policy.md) and the
|
|
97
|
+
[final qualification record](docs/superpowers/reports/2026-11-16-opt-in-cause-loss.md).
|
|
95
98
|
Accepting a version option alone is not proof of adaptation. The rule/group
|
|
96
99
|
publication guard passes at 2.0.0; release and registry verification are recorded
|
|
97
100
|
in the [release checklist](docs/superpowers/reports/2026-10-01-effect4-release-preparation.md).
|
|
@@ -216,13 +219,13 @@ the package's recommended syntax-only `linteffect/*` rules and enables Oxc's
|
|
|
216
219
|
type-aware engine, but it does not select any `typescript/*` rules or enable
|
|
217
220
|
`typeCheck` compiler diagnostics.
|
|
218
221
|
|
|
219
|
-
Install the
|
|
222
|
+
Install the standard `tsgolint` backend in the consuming project:
|
|
220
223
|
|
|
221
224
|
```bash
|
|
222
225
|
bun add -d oxlint oxlint-tsgolint @opsydyn/oxlint-effect
|
|
223
226
|
```
|
|
224
227
|
|
|
225
|
-
The current
|
|
228
|
+
The current `oxlint-tsgolint` releases use TypeScript 7. Keep `oxlint`, `oxlint-tsgolint`,
|
|
226
229
|
TypeScript, and the consumer's project configuration compatible. In a
|
|
227
230
|
monorepo, build dependent packages so their declarations can be resolved
|
|
228
231
|
before type-aware linting runs.
|
|
@@ -270,6 +273,31 @@ API](https://oxc.rs/docs/guide/usage/linter/js-plugins.html) does not support
|
|
|
270
273
|
custom type-aware rules, so semantic Effect rules remain deferred until Oxc
|
|
271
274
|
provides supported typed-plugin access.
|
|
272
275
|
|
|
276
|
+
#### Optional tsrs Backend
|
|
277
|
+
|
|
278
|
+
[Oxlint 1.92.0 or newer](https://github.com/oxc-project/oxc/releases/tag/oxlint_v1.92.0)
|
|
279
|
+
can discover `tsrs-lint` as an [alternative backend](https://oxc.rs/blog/2026-11-17-faster-type-aware-linting-with-tsrs)
|
|
280
|
+
for its built-in type-aware rules.
|
|
281
|
+
In a consumer that already uses the plugin, install the pinned preview pair:
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
bun add -d -E oxlint@1.94.0 tsrs@0.25.0-ts7.1.0-beta
|
|
285
|
+
bunx --no-install oxlint --type-aware src
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Keep the same `typeAware` preset (or `effect3.typeAware` for Effect 3), rule
|
|
289
|
+
options, and standalone typecheck. There is no new preset or plugin dependency.
|
|
290
|
+
Oxlint prefers the discoverable `tsrs-lint` launcher, even when
|
|
291
|
+
`oxlint-tsgolint` is also installed locally. To roll back, run `bun remove tsrs`
|
|
292
|
+
and retain or restore a compatible `oxlint-tsgolint`; check for a remaining
|
|
293
|
+
`tsrs-lint` on `PATH` or an explicit `OXLINT_TSGOLINT_PATH` override.
|
|
294
|
+
|
|
295
|
+
Use this preview for linting, not to replace a whole-project compiler check.
|
|
296
|
+
The macOS arm64 trial matched Effect 3 and 4 lint diagnostics, but the two
|
|
297
|
+
backends did not report identical compiler diagnostics with `--type-check`.
|
|
298
|
+
Linux and editor integration have not been verified by this project.
|
|
299
|
+
See the [optional packed-consumer check](examples/type-aware-consumer/README.md#optional-tsrs-verification).
|
|
300
|
+
|
|
273
301
|
### Configure One Rule Group
|
|
274
302
|
|
|
275
303
|
Every named preset in the following table is exported as a config-shaped preset
|
|
@@ -366,6 +394,14 @@ or repair a domain-modeling issue. The skill preserves existing configuration
|
|
|
366
394
|
and uses the installed package's APIs and rules. Type-aware linting is opt-in.
|
|
367
395
|
Intentional `EXPECT`/`QA` failures are retained as diagnostic controls.
|
|
368
396
|
|
|
397
|
+
Version 2.3.0 adds [cause-narrowing review guidance](./skills/oxlint-effect/references/cause-narrowing.md),
|
|
398
|
+
with paired current/legacy counterexamples, repairs and executable contracts.
|
|
399
|
+
It checks original cause identity, observer sequencing, error/environment types
|
|
400
|
+
and an explicit public projection. The opt-in `no-error-cause-loss` rule
|
|
401
|
+
diagnoses the three matched cause-erasure examples when explicitly enabled.
|
|
402
|
+
Other `REVIEW-ONLY` cases still document gaps rather than implemented warnings. This is agent
|
|
403
|
+
guidance, not a port of anti-slop's complete lint policy or an LLM judging service.
|
|
404
|
+
|
|
369
405
|
The [skill](./skills/oxlint-effect/SKILL.md), its focused references, and
|
|
370
406
|
paired [Effect 4 failures](./skills/oxlint-effect/assets/effect4/domain.bad.ts) and
|
|
371
407
|
[repairs](./skills/oxlint-effect/assets/effect4/domain.good.ts) are also included in the
|
|
@@ -403,7 +439,7 @@ Paired [expected-state failures](./skills/oxlint-effect/assets/effect4/expected-
|
|
|
403
439
|
and [repairs](./skills/oxlint-effect/assets/effect4/expected-state.good.ts) cover ordinary
|
|
404
440
|
absence, broad null recovery and thrown expected rejection. Their
|
|
405
441
|
[guide](./skills/oxlint-effect/references/expected-state.md) explains the required
|
|
406
|
-
caller changes. The corpus now covers all
|
|
442
|
+
caller changes. The corpus now covers all 22 exported DDD rules with representative
|
|
407
443
|
annotated failures, full-DDD clean controls and tested contracts.
|
|
408
444
|
CI checks referenced rules and presets, relative
|
|
409
445
|
links, npm inclusion, TypeScript contracts, intentional diagnostics, and clean
|
|
@@ -633,21 +669,44 @@ export default defineConfig({
|
|
|
633
669
|
|
|
634
670
|
### Concurrency Safety
|
|
635
671
|
|
|
672
|
+
**Version scope:** plugin **2.2.0 and later** changes the three race/shared-state
|
|
673
|
+
rules below for both majors. Published 2.1.x retains the
|
|
674
|
+
previous policy. Rule IDs, group selection and preset membership are unchanged.
|
|
675
|
+
These three rules now resolve actual value imports: `Effect as Fx`, namespace
|
|
676
|
+
imports from `effect` / `effect/Effect`, and named subpath operations. Direct,
|
|
677
|
+
curried and terminal pipe forms are supported; shadowed and type-only bindings
|
|
678
|
+
are excluded. This does not claim alias support for every concurrency rule.
|
|
679
|
+
|
|
680
|
+
Race warnings require visible resource-shaped acquisition without a local
|
|
681
|
+
cleanup owner. Pure or opaque operands do not need dummy finalizers. Cleanup on
|
|
682
|
+
another branch does not own an acquisition. Collection mutation warnings require
|
|
683
|
+
an explicit literal budget above one, global `Infinity` or `"unbounded"`; omission
|
|
684
|
+
and `1` are sequential and clean. Later opaque spreads/computed keys, named
|
|
685
|
+
budgets and legacy `"inherit"` remain unknown, not proven safe. Same-file lexical
|
|
686
|
+
ownership excludes worker-local/shadowed bindings and unexecuted callbacks.
|
|
687
|
+
|
|
688
|
+
See paired [Effect 4 failures](examples/effect4-consumer/src/concurrency-accuracy.bad.ts)
|
|
689
|
+
and [clean controls](examples/effect4-consumer/src/concurrency-accuracy.good.ts), or
|
|
690
|
+
the [legacy failures](examples/effect3-consumer/src/concurrency-accuracy.bad.ts)
|
|
691
|
+
and [controls](examples/effect3-consumer/src/concurrency-accuracy.good.ts).
|
|
692
|
+
The packed harness checks exact diagnostics, ordered values, atomic updates,
|
|
693
|
+
first-success/first-completion semantics, and the existing loser-release contracts.
|
|
694
|
+
|
|
636
695
|
| Rule | Catches | Why |
|
|
637
696
|
| --- | --- | --- |
|
|
638
697
|
| `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
698
|
| `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
699
|
| `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` |
|
|
700
|
+
| `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
701
|
| `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
702
|
| `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
703
|
| `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
704
|
| `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` |
|
|
705
|
+
| `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
706
|
| `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
707
|
| `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
708
|
| `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` |
|
|
709
|
+
| `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
710
|
| `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
711
|
| `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
712
|
| `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. |
|
|
@@ -716,7 +775,7 @@ support the same `boundaryPaths` option as the other lifecycle rules.
|
|
|
716
775
|
Q22's cleanup, scope and success-value examples use pinned Effect 3.21.4/4.0.0
|
|
717
776
|
consumers. Behavioural qualification is recorded in the
|
|
718
777
|
[campaign report](docs/superpowers/reports/2026-10-01-effect4-complete-qualification.md#q22-cleanup-manual-scopes-and-resource-success-values);
|
|
719
|
-
Q22-Q24
|
|
778
|
+
Historical Q22-Q24 closure passed the then-current 30 KB size gate.
|
|
720
779
|
|
|
721
780
|
Prefer the supplied `Effect.scope` inside `Effect.scoped`, or acquire a manual
|
|
722
781
|
`Scope.make()` with `Effect.acquireUseRelease` and release it using
|
|
@@ -836,6 +895,33 @@ not currently expose it; it is not part of the v1 export surface.
|
|
|
836
895
|
|
|
837
896
|
### Error Modeling
|
|
838
897
|
|
|
898
|
+
**Since 2.3.0:** `no-error-cause-loss` is included in `errorModeling`,
|
|
899
|
+
`ddd` and `allRules` for both majors. It is **not** enabled by `recommended` or
|
|
900
|
+
`typeAware`. Version 2.2.0 does not export this rule. Users upgrading with an
|
|
901
|
+
explicit error/DDD group selection may see new diagnostics.
|
|
902
|
+
|
|
903
|
+
Enable it only where the owner requires retaining the original error when
|
|
904
|
+
wrapping it. It checks direct `new` constructor returns in synchronous inline
|
|
905
|
+
`mapError` handlers and `Effect.fail(new ...)` in broad recovery. Legacy recovery
|
|
906
|
+
is `catchAll`/`catchAllCause`; current is `catch`/`catchEager`/`catchCause`, with
|
|
907
|
+
`mapErrorEager` also supported. Direct/data-last calls, block and conditional
|
|
908
|
+
returns, value-import aliases and subpath imports are recognised by binding.
|
|
909
|
+
|
|
910
|
+
Passing the original as an argument, or inside a literal object/array, avoids a
|
|
911
|
+
warning without mandating a field name. Later keys win; a later opaque spread,
|
|
912
|
+
dynamic computed field, helper result, alias, destructured/reassigned parameter, async
|
|
913
|
+
handler or generator stays unknown, **not proven safe**. Named handlers, factory
|
|
914
|
+
`.make`, specialised recovery tables and cross-file constructor storage are not
|
|
915
|
+
inferred. A constructor can still ignore a passed input. Logging is not a bypass.
|
|
916
|
+
|
|
917
|
+
For a single manual Effect 4 rule, use
|
|
918
|
+
`"linteffect/no-error-cause-loss": ["error", { effectVersion: 4 }]`; use `3` for
|
|
919
|
+
legacy consumers. Register the plugin once using the existing configuration.
|
|
920
|
+
See the [cause guide](skills/oxlint-effect/references/cause-narrowing.md) and
|
|
921
|
+
[annotated app example](examples/backend/cause-narrowing-review.ts). There is no
|
|
922
|
+
automatic fix: intentional captured-and-erased public translations may be valid,
|
|
923
|
+
and internal causes must not be exposed in public payloads merely to clear lint.
|
|
924
|
+
|
|
839
925
|
Public Effect operations should expose one structured, recoverable error
|
|
840
926
|
channel. The `ddd` preset includes the complete Domain Modeling and Error
|
|
841
927
|
Modeling groups; DDD-only rules remain opt-in to keep `recommended` compatible
|
|
@@ -848,6 +934,7 @@ with existing projects.
|
|
|
848
934
|
| `linteffect/no-mixed-effect-error-shapes` | Public error unions mixing `Error`, `unknown`, string, number, or boolean shapes. | A single tagged error union keeps recovery and observability predictable. |
|
|
849
935
|
| `linteffect/no-effect-fail-error-message` | `Effect.fail(error.message)`, string concatenation, or templates that stringify an error. | Preserves the original error tag, cause, and context instead of collapsing it into a string. |
|
|
850
936
|
| `linteffect/no-catchall-generic-rethrow` | Plain `catch`/`catchEager` (v4) or `catchAll` (v3) handlers returning `Effect.fail(new Error(...))`. | Preserve the original error or explicitly map to a structured tagged error with its cause. |
|
|
937
|
+
| `linteffect/no-error-cause-loss` | Opt-in inline map/recovery constructors whose visible inputs omit or project away the original handler error. | Pass the original through an owned field or argument where retention is required. Uses lexical identity and effective object keys; opaque inputs stay unknown. Does not prove constructor storage, telemetry delivery or valid public disclosure. |
|
|
851
938
|
| `linteffect/no-log-only-error-handling` | V4 catch/eager/Cause/defect/filter/tag/reason handlers and maps that log without modelling or retaining failure. Legacy v3 also reports `tapError`. | Re-fail typed errors, retain causes with `failCause`, or retain defects with `die`. V4 observers (`tapError`, `tapCause`, `tapDefect`) stay clean because they preserve failure. |
|
|
852
939
|
| `linteffect/no-early-catchall-null` | Non-boundary `catch`/`catchEager` (v4) or `catchAll` (v3) recovery with `Effect.succeed(null)`, `undefined`, or an identifier containing fallback/default. | Propagate typed failures or recover at a configured boundary instead of leaking untyped absence. |
|
|
853
940
|
| `linteffect/no-expected-state-as-error` | `Effect.fail("NotFound")`, `"Missing"`, `"Empty"`, or `"None"`. | Models expected states as `Option`, `Result` (v4), `Either` (v3), or tagged data instead of overloading failure. |
|
package/dist/index.d.mts
CHANGED
|
@@ -228,6 +228,9 @@ declare const reactAndRuntimeBoundariesRules: {
|
|
|
228
228
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
229
229
|
effectVersion: 4;
|
|
230
230
|
}];
|
|
231
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
232
|
+
effectVersion: 4;
|
|
233
|
+
}];
|
|
231
234
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
232
235
|
effectVersion: 4;
|
|
233
236
|
}];
|
|
@@ -261,6 +264,9 @@ declare const reactAndRuntimeBoundariesRules: {
|
|
|
261
264
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
262
265
|
effectVersion: 4;
|
|
263
266
|
}];
|
|
267
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
268
|
+
effectVersion: 4;
|
|
269
|
+
}];
|
|
264
270
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
265
271
|
effectVersion: 4;
|
|
266
272
|
}];
|
|
@@ -535,6 +541,9 @@ declare const reactAndRuntimeBoundariesRules: {
|
|
|
535
541
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
536
542
|
effectVersion: 4;
|
|
537
543
|
}];
|
|
544
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
545
|
+
effectVersion: 4;
|
|
546
|
+
}];
|
|
538
547
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
539
548
|
effectVersion: 4;
|
|
540
549
|
}];
|
|
@@ -1138,6 +1147,9 @@ declare const reactAndRuntimeBoundariesRules: {
|
|
|
1138
1147
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
1139
1148
|
effectVersion: 4;
|
|
1140
1149
|
}];
|
|
1150
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
1151
|
+
effectVersion: 4;
|
|
1152
|
+
}];
|
|
1141
1153
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
1142
1154
|
effectVersion: 4;
|
|
1143
1155
|
}];
|
|
@@ -1172,6 +1184,9 @@ declare const reactAndRuntimeBoundariesRules: {
|
|
|
1172
1184
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
1173
1185
|
effectVersion: 4;
|
|
1174
1186
|
}];
|
|
1187
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
1188
|
+
effectVersion: 4;
|
|
1189
|
+
}];
|
|
1175
1190
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
1176
1191
|
effectVersion: 4;
|
|
1177
1192
|
}];
|
|
@@ -2066,6 +2081,9 @@ declare const reactAndRuntimeBoundariesRules: {
|
|
|
2066
2081
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
2067
2082
|
effectVersion: 4;
|
|
2068
2083
|
}];
|
|
2084
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
2085
|
+
effectVersion: 4;
|
|
2086
|
+
}];
|
|
2069
2087
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
2070
2088
|
effectVersion: 4;
|
|
2071
2089
|
}];
|
|
@@ -2105,6 +2123,9 @@ declare const reactAndRuntimeBoundariesRules: {
|
|
|
2105
2123
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
2106
2124
|
effectVersion: 4;
|
|
2107
2125
|
}];
|
|
2126
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
2127
|
+
effectVersion: 4;
|
|
2128
|
+
}];
|
|
2108
2129
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
2109
2130
|
effectVersion: 4;
|
|
2110
2131
|
}];
|
|
@@ -3046,6 +3067,9 @@ declare const reactAndRuntimeBoundariesRules: {
|
|
|
3046
3067
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
3047
3068
|
effectVersion: 4;
|
|
3048
3069
|
}];
|
|
3070
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
3071
|
+
effectVersion: 4;
|
|
3072
|
+
}];
|
|
3049
3073
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
3050
3074
|
effectVersion: 4;
|
|
3051
3075
|
}];
|
|
@@ -3086,6 +3110,9 @@ declare const reactAndRuntimeBoundariesRules: {
|
|
|
3086
3110
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
3087
3111
|
effectVersion: 4;
|
|
3088
3112
|
}];
|
|
3113
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
3114
|
+
effectVersion: 4;
|
|
3115
|
+
}];
|
|
3089
3116
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
3090
3117
|
effectVersion: 4;
|
|
3091
3118
|
}];
|
|
@@ -3480,6 +3507,9 @@ declare const effect3: {
|
|
|
3480
3507
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
3481
3508
|
effectVersion: 3;
|
|
3482
3509
|
}];
|
|
3510
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
3511
|
+
effectVersion: 3;
|
|
3512
|
+
}];
|
|
3483
3513
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
3484
3514
|
effectVersion: 3;
|
|
3485
3515
|
}];
|
|
@@ -3514,6 +3544,9 @@ declare const effect3: {
|
|
|
3514
3544
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
3515
3545
|
effectVersion: 3;
|
|
3516
3546
|
}];
|
|
3547
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
3548
|
+
effectVersion: 3;
|
|
3549
|
+
}];
|
|
3517
3550
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
3518
3551
|
effectVersion: 3;
|
|
3519
3552
|
}];
|
|
@@ -3808,6 +3841,9 @@ declare const effect3: {
|
|
|
3808
3841
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
3809
3842
|
effectVersion: 3;
|
|
3810
3843
|
}];
|
|
3844
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
3845
|
+
effectVersion: 3;
|
|
3846
|
+
}];
|
|
3811
3847
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
3812
3848
|
effectVersion: 3;
|
|
3813
3849
|
}];
|
|
@@ -4446,6 +4482,9 @@ declare const effect3: {
|
|
|
4446
4482
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
4447
4483
|
effectVersion: 3;
|
|
4448
4484
|
}];
|
|
4485
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
4486
|
+
effectVersion: 3;
|
|
4487
|
+
}];
|
|
4449
4488
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
4450
4489
|
effectVersion: 3;
|
|
4451
4490
|
}];
|
|
@@ -4480,6 +4519,9 @@ declare const effect3: {
|
|
|
4480
4519
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
4481
4520
|
effectVersion: 3;
|
|
4482
4521
|
}];
|
|
4522
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
4523
|
+
effectVersion: 3;
|
|
4524
|
+
}];
|
|
4483
4525
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
4484
4526
|
effectVersion: 3;
|
|
4485
4527
|
}];
|
|
@@ -5431,6 +5473,9 @@ declare const effect3: {
|
|
|
5431
5473
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
5432
5474
|
effectVersion: 3;
|
|
5433
5475
|
}];
|
|
5476
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
5477
|
+
effectVersion: 3;
|
|
5478
|
+
}];
|
|
5434
5479
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
5435
5480
|
effectVersion: 3;
|
|
5436
5481
|
}];
|
|
@@ -5471,6 +5516,9 @@ declare const effect3: {
|
|
|
5471
5516
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
5472
5517
|
effectVersion: 3;
|
|
5473
5518
|
}];
|
|
5519
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
5520
|
+
effectVersion: 3;
|
|
5521
|
+
}];
|
|
5474
5522
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
5475
5523
|
effectVersion: 3;
|
|
5476
5524
|
}];
|
|
@@ -6465,6 +6513,9 @@ declare const effect3: {
|
|
|
6465
6513
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
6466
6514
|
effectVersion: 3;
|
|
6467
6515
|
}];
|
|
6516
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
6517
|
+
effectVersion: 3;
|
|
6518
|
+
}];
|
|
6468
6519
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
6469
6520
|
effectVersion: 3;
|
|
6470
6521
|
}];
|
|
@@ -6505,6 +6556,9 @@ declare const effect3: {
|
|
|
6505
6556
|
"linteffect/no-catchall-generic-rethrow": ["error", {
|
|
6506
6557
|
effectVersion: 3;
|
|
6507
6558
|
}];
|
|
6559
|
+
"linteffect/no-error-cause-loss": ["error", {
|
|
6560
|
+
effectVersion: 3;
|
|
6561
|
+
}];
|
|
6508
6562
|
"linteffect/no-log-only-error-handling": ["error", {
|
|
6509
6563
|
effectVersion: 3;
|
|
6510
6564
|
}];
|