@opsydyn/oxlint-effect
v2.6.0
Published
Oxlint plugin rules for Effect TypeScript code shape constraints.
Readme
@opsydyn/oxlint-effect
Oxlint plugin rules for Effect TypeScript code-shape constraints.
Quick Start
Requires Node.js 22 or newer. Version 2.x targets Effect 4 by default.
bun add -d oxlint @opsydyn/oxlint-effectWith npm, use npm install -D oxlint @opsydyn/oxlint-effect instead.
Create oxlint.config.ts at your project root:
import { defineConfig } from "oxlint";
import { recommended } from "@opsydyn/oxlint-effect";
export default defineConfig({
plugins: ["typescript"],
jsPlugins: [...recommended.jsPlugins],
rules: recommended.rules,
});Run against your source directory:
bunx oxlint --config oxlint.config.ts srcWith npm, use npx oxlint --config oxlint.config.ts src.
recommended.jsPlugins is readonly; spreading it produces the mutable array
Oxlint expects. When adopting this in an existing config, preserve its plugins,
rules, ignores and overrides, and register linteffect only once.
Start with recommended for broad policy, or choose a focused group such as
ddd below. The published 2.0.0 example
installs from npm and checks annotated failures alongside clean repairs.
- Effect 3 migration
- Individual groups and composition
- Type-aware opt-in
- Effect UI strict opt-in
- Agent skill
- Editor setup and missing diagnostics
- Rule catalogue
Effect Versions
Traced Functions And Explicit Contracts
Version scope: these changes apply to plugin 2.1.0 and later. Version 2.0.x retains the previous recommended bans and option-presence concurrency checks.
recommended and effect3.recommended allow generator-based Effect.fn,
explicit Effect.Effect/Layer.Layer annotations and named Effect type aliases.
Named Effect.fn supplies tracing and stack-frame context; public service
contracts may deliberately specify success, error and requirement channels.
Prefer inference within implementations without erasing meaningful interfaces.
See Effect.fn and the
official service guide.
The registered no-effect-fn-generator, no-manual-effect-channels and
no-effect-type-alias rules are now opt-in style restrictions, excluded from
both recommended maps and their typeAware companions. effectComposition and
allRules deliberately retain them; disable those three entries when composing
that full group and allowing these patterns. No rule ID was removed. Other
opinionated defaults are unchanged by this bounded recalibration.
Both packed consumers include annotated current failures and valid traced service contracts, plus matching legacy files. Their runtime checks verify service values and the automatic span name. Throwing inside Effect.fn remains a typed-failure warning; supporting the function form does not permit unsafe bodies.
Published 2.0.0 makes default exports Effect 4 policy and adds effect3 for
legacy projects. Version 2.3.0 adds one opt-in rule, for 147 registered rules
and 18 groups, qualified for their documented forms against the pinned majors:
147 legacy Effect 3 cases and 142 current Effect 4 cases, with five legacy-only policies.
Published 1.x packages retain their original Effect 3 behaviour and do not
provide the new namespace. See the compatibility roadmap
and per-rule audit for detection scope.
The 2.0.0 release
includes migration notes. Older 1.x packages do not export effect3; upgrade
the plugin to 2.x to use the explicit legacy presets without upgrading Effect.
bun run test:effect-versions verifies pinned packed Effect 3.22.1 and 4.0.0
consumers, with exact warning counts, clean controls and config typechecks.
All Q01-Q52 now have behavioural evidence in the matching packed consumers.
The original compatibility release used a 30 KB runtime cap. Version 2.3.0
uses an explicitly reviewed 31 KB cap for the cause-loss addition; see
ADR 0004 and the
final qualification record.
Accepting a version option alone is not proof of adaptation. The rule/group
publication guard passes at 2.0.0; release and registry verification are recorded
in the release checklist.
Additional group-by-group evidence is tracked in the
wider qualification report
and both consumers' qualification-cases.json. Each case requires annotated bad
sources, passing clean controls and literal per-file diagnostic counts. Run
bun scripts/verify-effect-version-consumers.ts --require-complete after a build
to reject any unqualified applicable rule or group; it passes this qualified checkout.
The Effect 4 qualification index is the primary QA corpus. The legacy index and original reference app remain explicitly Effect 3. The packaged skill has current versioned guidance and paired Effect 4 assets, with legacy assets retained. This is lint/type/runtime contract QA, not a launched application or browser/React adapter acceptance.
Configure Legacy Effect 3
Every group and its rules-only companion is available under effect3 in the
published 2.x configuration. Default ddd targets Effect 4; legacy projects use:
import { defineConfig } from "oxlint";
import { effect3 } from "@opsydyn/oxlint-effect";
export default defineConfig({
jsPlugins: [...effect3.ddd.jsPlugins],
rules: effect3.ddd.rules,
});For rules-only composition, use effect3.domainModelingRules and
effect3.errorModelingRules. The namespace also includes recommended,
recommendedRules, allRules, ruleGroups, presets, typeAware and jsPlugins.
No second plugin registration is needed. effect3.typeAware remains opt-in.
Version-sensitive rule entries are tuples with effectVersion: 3 | 4.
Manually enabling a sensitive rule without options selects 4. When customising
severity or paths, specify the major explicitly rather than discarding it:
export default defineConfig({
jsPlugins: [...effect3.jsPlugins],
rules: {
...effect3.dddRules,
"linteffect/no-early-catchall-null": [
"warn",
{ effectVersion: 3, boundaryPaths: ["src/http/**", "test/**"] },
],
},
});For Effect 4 manual policy, use ["error", { effectVersion: 4 }]. Ordinary Oxlint
override/merge rules apply; there is no process-wide version detection.
Version-neutral rules keep severity-only entries and existing options.
allRules includes all rules applicable to the selected major, not every
registered rule. The five currently identified v3-only rules remain registered
and available in effect3: require-service-accessors,
require-service-dependencies, no-effect-async, no-effect-orElse-ladder and
no-runtime-runfork (current Runtime has no runFork export).
no-fromnullable-nullish-coalesce applies to both majors: it recognises current
Option.fromNullishOr and legacy Option.fromNullable under the same stable ID.
The audit may identify further restrictions.
Recovery And Runtime Across Majors
In 2.x, the plain-recovery rules recognise Effect.catch
for Effect 4 and Effect.catchAll under effectVersion: 3. IDs retain catchall
for configuration stability. Both direct and piped operators, expression
callbacks and block returns are covered. Original structured errors and explicit
tagged mappings remain clean; Cause, defect, filtered and reason handlers are
not treated as plain recovery. A legacy spelling under v4 is not a migration
warning.
no-run-effect-outside-boundary covers runCallback, runFork, runPromise,
runPromiseExit, runSync and runSyncExit. Effect 4 additionally covers their
six With forms at execution: Effect.runPromiseWith(context)(program).
Effect.runPromiseWith(context) alone creates a runner and does not warn.
Stored runner aliases, renamed imports and computed properties are not covered.
The runner rule now honours boundaryPaths for both majors, correcting its old
behaviour of warning even at boundaries. It shares these conservative defaults
with early fallback recovery: bin/**, scripts/**, cli/**, **/main.ts,
app/api/**/route.ts, server/**, *.test.ts, *.spec.ts. Custom paths replace
defaults; [] exempts nothing. Keep effectVersion in custom option tuples:
"linteffect/no-run-effect-outside-boundary": [
"warn",
{ effectVersion: 3, boundaryPaths: ["src/http/**", "test/**"] },
],Return an Effect from domain logic, preserve structured failures, and execute or recover at your configured boundary. A context-supplied runner is not evidence of missing Layer provision; syntax cannot prove context completeness. See annotated Effect 4 failures, legacy recovery failures and the qualification report.
Editor Setup And Missing Diagnostics
Use the official Oxc extension (oxc.oxc-vscode) in VS Code and install Oxlint
locally in the workspace. See the official editor setup.
If a warning is missing, first run the CLI against the same file with an explicit
config path. Check the selected group, rule overrides, ignores and configured
boundary paths. Custom Effect rules are syntax-only; an unrecognised import or
alias is not proof that the code is safe. If the CLI warns but the editor does
not, check the extension's workspace/config resolution and restart its language
server after dependency changes. Intentional EXPECT/QA examples must retain
their warnings; use the example's qa command rather than fixing the failures.
Configure Type-Aware Linting
typeAware is an opt-in configuration bridge to Oxc's type-aware
linting. It preserves
the package's recommended syntax-only linteffect/* rules and enables Oxc's
type-aware engine, but it does not select any typescript/* rules or enable
typeCheck compiler diagnostics.
Install the standard tsgolint backend in the consuming project:
bun add -d oxlint oxlint-tsgolint @opsydyn/oxlint-effectThe current oxlint-tsgolint releases use TypeScript 7. Keep oxlint, oxlint-tsgolint,
TypeScript, and the consumer's project configuration compatible. In a
monorepo, build dependent packages so their declarations can be resolved
before type-aware linting runs.
import { defineConfig } from "oxlint";
import { typeAware } from "@opsydyn/oxlint-effect";
export default defineConfig({
options: typeAware.options,
jsPlugins: [...typeAware.jsPlugins],
plugins: ["typescript", "unicorn", "oxc"],
rules: {
...typeAware.rules,
"typescript/no-floating-promises": "error",
"typescript/no-misused-promises": "error",
},
});options.typeAware must be at the root of the resolved Oxlint configuration;
do not place it in an override or nested configuration object. The package
uses only that option. The two typescript/* entries above are selected by the
consumer; typeAware.rules itself does not include them. Consumers may also
separately opt into compiler diagnostics:
oxlint --type-awareexport default defineConfig({
options: {
typeAware: true,
typeCheck: true,
},
});The CLI enables the same type-aware engine without this package preset. The
second configuration is consumer-owned and is not part of typeAware.
The package's custom Effect rules remain syntax-only. Oxc's JavaScript plugin API does not support custom type-aware rules, so semantic Effect rules remain deferred until Oxc provides supported typed-plugin access.
Optional tsrs Backend
Oxlint 1.92.0 or newer
can discover tsrs-lint as an alternative backend
for its built-in type-aware rules.
In a consumer that already uses the plugin, install the pinned preview pair:
bun add -d -E [email protected] [email protected]
bunx --no-install oxlint --type-aware srcKeep the same typeAware preset (or effect3.typeAware for Effect 3), rule
options, and standalone typecheck. There is no new preset or plugin dependency.
Oxlint prefers the discoverable tsrs-lint launcher, even when
oxlint-tsgolint is also installed locally. To roll back, run bun remove tsrs
and retain or restore a compatible oxlint-tsgolint; check for a remaining
tsrs-lint on PATH or an explicit OXLINT_TSGOLINT_PATH override.
Use this preview for linting, not to replace a whole-project compiler check.
The macOS arm64 trial matched Effect 3 and 4 lint diagnostics, but the two
backends did not report identical compiler diagnostics with --type-check.
Linux and editor integration have not been verified by this project.
See the optional packed-consumer check.
Boolean Blindness Opt-In
| Rule | Catches | Prefer |
| --- | --- | --- |
| linteffect/no-positional-boolean-literal | Bare true or false passed directly to a function, optional call, or constructor. | A named option such as submit(order, { notify: true }), a named value, or separate operations for distinct behaviors. |
Enable it with "linteffect/no-positional-boolean-literal": "warn" in
your Oxlint rules after registering the plugin. It works in JavaScript and
TypeScript without an Effect import. It is included in both majors'
allRules, but not in recommended, typeAware, or ddd. It does not resolve
variables, assertions, spread arguments, or other expressions. There is no
autofix. See the annotated example
and clean alternatives.
Effect UI Strict Opt-In
The next minor release adds the Effect 4-only effectUiStrict preset for
@effect/ui. It is not available in 2.4.0.
It does not change recommended, typeAware, or the shared group presets.
Current allRules also includes these rules; effect3.allRules does not.
import { defineConfig } from "oxlint";
import { effectUiStrict } from "@opsydyn/oxlint-effect";
export default defineConfig({
jsPlugins: [...effectUiStrict.jsPlugins],
rules: effectUiStrict.rules,
});When composing with an existing config, spread effectUiStrictRules into
rules and register linteffect only once. No Effect UI dependency or
type-aware backend is required by the plugin. The rules are scoped by
Effect UI imports in each file, not by project dependencies or filenames.
| Rule | Catches | Why |
| --- | --- | --- |
| linteffect/no-effect-ui-io-in-pure-callbacks | Direct global fetch, timers, listeners, network constructors, and document/storage member access in verified Effect UI projections. | Keep state transitions and rendering replayable; move host work into an owned Command, Subscription, Mount, Query, or Layer. |
| linteffect/no-effect-ui-runtime-escape | Direct Effect runners, invoked context-bound runners, and supported runner pipeline steps in those projections. | Keep the UI runtime in charge of starting work; issue a Command with $.run(...) instead of starting a separate Effect runtime. |
| linteffect/no-effect-ui-eager-boundary-io | Direct host I/O or Effect runners evaluated while constructing recognised Command, Subscription, Mount, Query, or Layer boundaries. | Work passed to a boundary has already started unless you defer it in the managed callback or a lazy Effect. |
The two callback rules resolve real value imports of Component and Html, including
aliases and namespace imports from @effect/ui and @effect/ui/html. They
check direct or const-bound definitions, inline make projections
(init, update, view, subscriptions, head), split update,
view, and fragment functions, and inline HTML .on message mappers
rooted at the view's builder argument. Command issuance, descriptor
construction, Query result reads, event options and standalone host bootstrap
remain valid.
The runtime rule resolves value imports from effect and effect/Effect.
It checks runSync, runSyncExit, runPromise, runPromiseExit, runFork,
and runCallback, including their *With(context) forms only when applied.
For example, Effect.runPromise(task) and pipe(task, Effect.runFork)
violate the rule inside an update. Effect.runPromiseWith(context) on its
own just builds a runner. Method pipelines are checked only on direct
Effect.succeed, fail, sync, gen, promise, tryPromise, or
suspend calls.
The eager-boundary rule checks arguments even outside UI projections. It
recognises imported Command.make, Mount.make/makeStream,
Subscription.make/direct, Command and Query service factory applications,
local service toLayer calls, and core Layer constructors in files that
value-import Effect UI. It checks nested argument expressions without entering
function bodies. For example, Layer.effect(Tag, Effect.succeed(fetch(url)))
starts the request before the Layer builds. Pass
Layer.effect(Tag, Effect.promise(() => fetch(url))) when the service should
be the response rather than an already-started promise. The service type must
match that change.
These are syntax-local checks, not a proof of purity. Imported helpers, unknown callbacks, aliased globals, spread options, stored runner aliases, arbitrary runtime objects, and imported service or issued descriptor factories are outside their scope. An eager argument inside a verified pure callback can trigger both a boundary and a callback rule. There is no autofix. See the pinned examples and Effect UI roadmap. This addition revises the single measured runtime cap to 33 kB; see ADR 0005.
Configure One Rule Group
Every named preset in the following table is exported as a config-shaped preset
with the same shape as recommended; use the same mutable-array workaround
for each one. For example, the ddd preset combines Domain Modeling and Error
Modeling rules:
import { defineConfig } from "oxlint";
import { ddd } from "@opsydyn/oxlint-effect";
export default defineConfig({
plugins: ["typescript"],
jsPlugins: [...ddd.jsPlugins],
rules: ddd.rules,
});Named group presets:
| Preset | Rule Group |
| --- | --- |
| reactAndRuntimeBoundaries | React and Runtime Boundaries |
| effectComposition | Effect Composition |
| concurrencySafety | Concurrency Safety |
| resourceLifetime | Resource Lifetime |
| pipelineShapeAndSequencing | Pipeline Shape and Sequencing |
| branchingAndLocalControlFlow | Branching and Local Control Flow |
| optionMatchAndDataNormalization | Option, Match, and Data Normalization |
| atomStateAndPlatformBoundaries | Atom, State, and Platform Boundaries |
| domainModeling | Domain Modeling |
| errorModeling | Error Modeling |
| ddd | Domain Modeling and Error Modeling |
| effectFlow | Effect Flow |
| pureTransformation | Pure Transformation |
| behaviorDecoration | Behavior Decoration |
| styleSeparation | Style Separation |
| serviceAndLayerArchitecture | Service and Layer Architecture |
| platformAndBoundaryHygiene | Platform and Boundary Hygiene |
| testingObservabilityAndQa | Testing, Observability, and QA |
Each preset also has a rule-only export with a Rules suffix. Use those when
you want to compose multiple groups. Compose typeAware with rule-only exports when a type-aware configuration needs
additional Effect policy:
import { defineConfig } from "oxlint";
import {
typeAware,
domainModelingRules,
errorModelingRules,
} from "@opsydyn/oxlint-effect";
export default defineConfig({
options: typeAware.options,
jsPlugins: [...typeAware.jsPlugins],
plugins: ["typescript", "unicorn", "oxc"],
rules: {
...typeAware.rules,
...domainModelingRules,
...errorModelingRules,
},
});For local development inside this repository, point jsPlugins at the TypeScript source:
import { defineConfig } from "oxlint";
import { allRules } from "./src/index";
export default defineConfig({
plugins: ["typescript"],
jsPlugins: [{ name: "linteffect", specifier: "./src/index.ts" }],
rules: allRules,
});Agent Skill
The companion oxlint-effect skill helps coding agents configure the npm
plugin, diagnose DDD warnings, and repair domain models when requested.
Effect 4 assets are primary; labelled Effect 3 assets are retained for legacy consumers. The versioned guide selects matching APIs, failure examples and repairs for every group.
npx skills add opsydyn/oxlint-effect --skill oxlint-effectAsk your agent to configure a selected group, explain a linteffect warning,
or repair a domain-modeling issue. The skill preserves existing configuration
and uses the installed package's APIs and rules. Type-aware linting is opt-in.
Intentional EXPECT/QA failures are retained as diagnostic controls.
Version 2.3.0 adds cause-narrowing review guidance,
with paired current/legacy counterexamples, repairs and executable contracts.
It checks original cause identity, observer sequencing, error/environment types
and an explicit public projection. The opt-in no-error-cause-loss rule
diagnoses the three matched cause-erasure examples when explicitly enabled.
Other REVIEW-ONLY cases still document gaps rather than implemented warnings. This is agent
guidance, not a port of anti-slop's complete lint policy or an LLM judging service.
The skill, its focused references, and
paired Effect 4 failures and
repairs are also included in the
npm package under skills/oxlint-effect. Skill installation is separate from
npm installation; installing the plugin alone does not activate agent guidance.
The initial examples cover branded IDs, explicit notification modes, and
structured transfer errors. Additional paired domain shape failures
and repairs cover typed
commands, epoch-millisecond time values, and schema-backed options. Their tests
check wire roundtrips, optional fields, invalid inputs, and rejected type misuse.
Paired domain decision failures
and repairs cover status
variants, business predicates, and explicit lifecycle states. Their tests check
the original decision results, legacy flag roundtrips, and valid/invalid
transitions. The decision guide
documents the example's boundary and lifecycle policies.
Paired domain context failures
and repairs cover explicit
policy requirements, modelled time inputs, and meaningful error payloads. The
context guide distinguishes
typed identity from authority and time conversion from clock reads.
Paired public error failures
and repairs cover generic,
unknown, and mixed public error channels. The
public error guide explains
cause preservation, selective recovery, caller migration and defect ownership.
Paired error preservation failures
and repairs cover
message-only failures, generic rethrows and log-only handlers. The
preservation guide
explains recovery ownership; use the versioned guide for current catch versus
legacy catchAll APIs. Topic guides retain labelled legacy walkthroughs.
Paired expected-state failures
and repairs cover ordinary
absence, broad null recovery and thrown expected rejection. Their
guide explains the required
caller changes. The corpus now covers all 22 exported DDD rules with representative
annotated failures, full-DDD clean controls and tested contracts.
CI checks referenced rules and presets, relative
links, npm inclusion, TypeScript contracts, intentional diagnostics, and clean
DDD repairs. This validates the examples and package contract, not the quality
of every agent-generated repair.
Rule Groups
The recommended config enables the broadly applicable rules as errors. Strict groups can add more opinionated checks where a team has adopted the associated workflow. The rules are heuristic: they flag code shapes that tend to hide Effect flow, domain meaning, or runtime boundaries.
React and Runtime Boundaries
| Rule | Catches | Why |
| --- | --- | --- |
| linteffect/no-react-state | Six bare/member React hook names; receiver/import ownership is not resolved. | Use externally owned props or a compatible adapter in v4; legacy advice names its Effect 3 atom-react adapter. SSR fixtures do not prove client integration. |
| linteffect/no-runtime-runfork | Legacy Runtime.runFork(...), including factories. Excluded from current presets because the export is removed. | Return Effect from domain logic and let an explicit boundary own execution and observation. |
| linteffect/no-run-effect-outside-boundary | Six direct Effect.run* calls and, in v4, immediate curried run*With(context)(program) execution outside configured boundaries. | Keeps runtime ownership at recognised boundaries; context factory creation is clean. |
| linteffect/no-or-die-outside-boundary | Effect.orDie calls/pipe arguments and legacy-only orDieWith. This historical owner is path-unaware; use explicit boundary overrides. | Keep domain errors typed; reserve intentional defect conversion for an explicitly owned boundary. |
| linteffect/prevent-dynamic-imports | Dynamic import(...). | Static imports keep dependency boundaries visible. |
| linteffect/no-render-side-effects | Import-gated Match.value(...).pipe(...) expression statements with branch operators, including ordinary pure statements. | Keep selection as a value and defer actual side effects to owned actions; syntax does not prove render context or purity. |
| linteffect/no-inline-runtime-provide | Inline Effect.provide(...) inside local runtime/generator chains. | Keeps dependency assembly at service or application boundaries. |
Effect Composition
| Rule | Catches | Why |
| --- | --- | --- |
| linteffect/no-effect-as | Direct Effect.as(...) wrappers. | Makes value flow explicit instead of discarding meaning behind a placeholder. |
| linteffect/no-effect-do | Effect.Do. | Avoids builder-style hidden sequencing. |
| linteffect/no-effect-bind | Effect.bind(...). | Prefers direct Effect.gen or pipeline flow over builder state. |
| linteffect/no-effect-async | Effect.async(...). | Manual callback bridges are easy to leak or resume incorrectly. |
| linteffect/no-effect-ignore | Effect.ignore(...) and pipe arguments such as Effect.ignore. | Makes ignored failures explicit at boundaries instead of burying failure ownership. |
| linteffect/no-effect-never | Effect.never. | Infinite effects should have explicit lifecycle and teardown ownership. |
| linteffect/no-effect-fn-generator | Opt-in style restriction on Effect.fn(function* ...); v4 also covers the named factory form. | Excluded from both recommended presets. Traced generators are supported Effect APIs; full group/all-rule users must disable this ban to retain them. |
| linteffect/no-nested-effect-gen | Effect.gen nested inside another Effect.gen; v4 includes { self } forms. | Keeps generator-based effects linear; v4 excludes separately defined nested functions. |
| linteffect/no-yield-without-star-in-effect-gen | Plain yield inside Effect.gen; v4 includes { self } forms. | Uses yield* for resumed-value typing and consistent workflow style. Plain yield can execute in v4; the rule is a delegation-style policy, not an interpreter-failure claim. |
| linteffect/no-async-effect-combinator-callback | async callbacks passed to supported Effect combinators; v4 includes mapEager, flatMapEager, recovery families and handler maps. | Adapts Promise APIs with Effect.tryPromise in gen/flatMap; map callbacks stay pure. Some legacy overloads accept Promises; the rule still requires explicit ownership. |
| linteffect/no-throw-in-effect-logic | throw inside Effect.gen or supported callbacks; v4 includes eager mapping/sequencing, { self } and recovery maps. | Delegates yield* Effect.fail(taggedError) in gen or returns it from flatMap. Returning an Effect from map or a generator succeeds with nested Effect data, not a typed failure. V4 excludes separately defined nested functions. |
| linteffect/no-try-catch-in-effect-logic | try/catch inside gen or supported callbacks; v4 includes eager mapping/sequencing, { self } and recovery maps. | Adapts throwing APIs with Effect.try and recovers with catch (v4), catchAll (v3), or catchTag. |
| linteffect/no-promise-api-in-effect-logic | Static Promise APIs and visible chains inside Effect logic; v4 includes eager mapping/sequencing, self-bound gen and recovery maps. | Adapts Promise APIs at a boundary. V4 excludes Effect.catch/unrelated receivers and cannot resolve stored aliases; v3 retains broad chain-name recognition. |
| linteffect/no-swallowed-catch-all | Plain catch/catchEager expression/block recovery (v4), piped catchAll expressions (v3), returning succeed/void/ignore or visibly successful asVoid. | Retains failure or uses an explicit typed domain branch. V4 asVoid(Effect.fail(error)) stays clean because it preserves failure; legacy asVoid policy is unchanged. |
| linteffect/no-manual-effect-channels | Opt-in inference-only restriction on explicit Effect/Layer annotations. | Excluded from both recommended presets; explicit service, public and polymorphic contracts are valid. |
| linteffect/no-effect-type-alias | Opt-in restriction on aliases around Effect.Effect<...>. | Excluded from both recommended presets; named public Effect contracts remain supported. |
| linteffect/no-public-generic-effect-error | Exported APIs returning Effect.Effect<_, Error, _>. | Public Effect APIs should expose tagged, recoverable domain errors instead of generic Error. |
Effect Flow
| Rule | Catches | Why |
| --- | --- | --- |
| linteffect/no-piped-yield-in-gen | Two or more yield* effect.pipe(...) steps inside one Effect.gen. | Keeps decorated effects named before the workflow so generator bodies read as a clear story. |
| linteffect/no-gen-for-mapping | Tiny Effect.gen blocks that yield once and return a pure transform. | Simple value mapping belongs in Effect.map or a named pure transformation, not workflow syntax. |
| linteffect/prefer-gen-for-workflow | Pipelines with three or more sequencing combinators such as Effect.flatMap, Effect.andThen, Effect.tap, or Effect.zipRight. | Long sequencing pipelines read like imperative workflow; Effect.gen makes the happy path explicit. |
| linteffect/no-business-logic-in-pipe | Strict: .pipe(Effect.flatMap(...)) callbacks with branching, service retrieval, or multiple Effect steps. | Keeps workflow decisions in Effect.gen and reserves pipe for behavior around a completed effect. |
Pure Transformation
| Rule | Catches | Why |
| --- | --- | --- |
| linteffect/no-large-anonymous-flow | flow(...) expressions with five or more transformation steps. | Large pure pipelines need a domain name so the transformation is reusable and reviewable. |
| linteffect/no-effect-in-flow | Effect.*, yield, await, async callbacks, console calls, Promise, or runtime access inside flow(...). | flow() should stay pure; effectful workflow, retries, logging, and dependency access belong in Effect code. |
| linteffect/prefer-named-flow | Non-trivial flow(...) expressions passed inline as callback/combinator arguments. | Naming the transformation makes DTO mapping and business calculations explicit instead of anonymous callback logic. |
| linteffect/prefer-flow-for-pure-pipeline | Strict: pure nested call towers three calls deep or more. | Names a reusable transformation pipeline instead of burying data flow in nested calls. |
Behavior Decoration
| Rule | Catches | Why |
| --- | --- | --- |
| linteffect/prefer-pipe-for-behavior | Static decorators whose first argument is a visible Effect call or pipe. V4 includes recovery families/maps and timeoutOption/timeoutOrElse/catchNoSuchElement. | Decorates with .pipe(); stored Effect aliases are outside the detector's syntax-local scope. V3 retains catchAll/catchSome/timeoutFail. |
| linteffect/prefer-decorated-effect-before-gen | Two or more decorated yields inside one Effect.gen; v4 includes { self } and recovery decoration. | Names decorated effects before the workflow. V4 excludes separately defined nested functions; one decorated yield stays below the threshold. |
| linteffect/no-workflow-in-behavior-pipe | Decorated pipes with multiple workflow operators or embedded control flow; v4 includes flatMapEager, while zipRight is legacy-only. | .pipe() should answer how an effect behaves, not bury multi-step workflow that belongs in Effect.gen. |
Style Separation
| Rule | Catches | Why |
| --- | --- | --- |
| linteffect/no-mixed-pillar-function | Function bodies containing three or more pillars: workflow, flow transformation, behaviour decoration and Layer construction. V4 includes its recovery operators and flatMapEager; legacy spellings remain under effect3. | Extract named workflows, transformations, policies and wiring. This syntax-local scan includes nested callbacks, not inferred named references. |
| linteffect/no-clever-effect-expression | Expressions with at least two pillars and call depth four or an inline function wrapper. Pillar recognition follows the selected Effect major. | Extract named steps; shallow multi-pillar and deep single-pillar expressions remain clean. |
| linteffect/prefer-extracted-concept | Anonymous block callbacks with at least three statements passed to calls in Effect-importing files, including ordinary JS calls. | Name the transformation, policy or workflow before passing it. Named callbacks, expression bodies and two-statement blocks remain clean; this is a syntax heuristic, not Effect type inference. |
Service and Layer Architecture
See service-provision guidance for both-major examples of ambient dependencies, intentional pins, and local overrides. Redundant re-provision remains review-only: matching a tag and instance does not prove a later caller would use that instance, and pinning does not extend resource lifetime.
| Rule | Catches | Why |
| --- | --- | --- |
| linteffect/prefer-effect-service | Legacy Context.Tag/GenericTag definitions; v4 also flags removed Effect.Service calls. | V4 repair: use Context.Service keys/classes, optional make and explicit layers. Bare v4 keys are valid. Legacy effect3 repair remains Effect.Service. The historical rule ID is retained. |
| linteffect/no-layer-provide-in-service-definition | V4 Layer.provide assembly inside inline Context.Service make, including function builders and class expressions; legacy checks Effect.Service class options. | Keep construction focused and move layer assembly to named app/test composition boundaries. Ordinary Layer.provide, including piped boundary composition, remains clean. Named builder aliases are not resolved. |
| linteffect/require-service-accessors | Legacy Effect.Service class options omitting or disabling accessors: true. | Legacy-only: generated accessors keep v3 service APIs consistent. Omitted from v4 presets and a no-op under explicit v4 manual policy; never add this option to Context.Service. |
| linteffect/require-service-dependencies | Legacy Effect.Service effect/scoped builders delegating to a *Service identifier without a dependencies option. | Legacy-only: declare dependency layers or provide them explicitly. This is an option-presence/name heuristic, not graph verification; an empty array passes the syntax check. Omitted and inactive in v4, where dependencies use explicit Layer composition. |
| linteffect/no-namespace-effect-import | Namespace imports from effect and its subpaths, plus the recognised atom-react package. | Use named imports to keep the surface explicit. Root/subpath controls compile in both majors; local namespace imports stay clean. Atom ecosystem compatibility is audited separately. |
| linteffect/no-manual-service-object-export | Named variable exports of *Service object literals containing functions or a direct Effect.fn builder, including pure methods. | V4 repair: Context.Service with explicit layers; legacy repair: Effect.Service. Data-only objects, other names, private objects and separately exported aliases stay clean under this syntax-local policy. |
| linteffect/no-layer-merge-in-request-handler | Layer.merge* or Layer.provide inside function declarations whose names end in Handler, Route or Request. | Extract boundary layer assembly. The name/declaration heuristic does not infer framework callback ownership or follow named builders. |
| linteffect/no-service-method-returning-promise | V4 Promise annotations, async methods and visible Promise returns in literal shapes constructed by inline Context.Service.make using functions, gen, generator fn, sync, succeed or pipes. Legacy checks retain their annotation/Promise-API traversal. | Return Effect methods. V4 Promise adapters and unused nested callbacks stay clean; named builders, stored Promise aliases and other opaque construction forms are not inferred. |
| linteffect/prefer-layer-pipe | Layer.provide towers nested in the input argument; diagnostics point to the inner provide call. | Preserve dependency order using .pipe(Layer.provide(...), ...). Single calls and nesting in the provider argument remain clean under this syntax-local policy. |
| linteffect/no-inline-layer-provide-in-program | Direct or piped Effect.provide / Layer.provide inside Effect.gen; v4 also recognises self-bound generators and generator Effect.fn, including named forms. | Move assembly outside workflow generators, retaining provider order. V4 inspects the generator's own scope; legacy traversal includes nested callbacks. Named provision aliases are not inferred. |
| linteffect/prefer-layer-mergeall-for-infrastructure | A Layer.merge call whose argument contains another Layer.merge. | Group independent layers with Layer.mergeAll; a single binary merge stays clean. This syntax heuristic does not prove dependency independence or authorise flattening dependent providers. |
| linteffect/no-service-layer-scatter | The third and each later variable declaration with a *Layer/*Live name and inline Layer.provide or Effect.provide, counted per file. | Group layers by concern; two matching declarations stay clean. Names are a heuristic, not type evidence; a multi-declarator declaration counts once, at its first matching declarator. |
Platform and Boundary Hygiene
| Rule | Catches | Why |
| --- | --- | --- |
| linteffect/no-node-fs-in-effect-code | fs, node:fs, fs/promises, and node:fs/promises imports and module-scope require() calls in Effect modules. | Effect code should stay portable and move Node filesystem access behind a platform boundary. |
| linteffect/no-json-parse-without-schema | JSON.parse(...) in Effect modules without an explicit Effect Schema import. | External JSON must be decoded through a schema at the boundary rather than trusted as an unvalidated value. |
| linteffect/no-date-now-in-effect | Date.now() within supported Effect construction boundaries. | Time should be supplied through Effect's Clock services so workflows remain deterministic and testable. |
| linteffect/no-new-date-in-domain-logic | new Date(...) in Effect-importing modules outside configured runtime boundaries. | Domain code should receive time through Clock or a modeled input rather than constructing a wall-clock value directly. |
| linteffect/no-node-platform-in-shared-code | Node built-in imports, including node:* and bare built-in module names, outside configured boundary paths. | Shared modules should remain portable and obtain platform capabilities through services or explicit application boundaries. |
| linteffect/no-process-env-direct-read | Direct and computed process.env reads outside configured boundary and configuration paths. | Environment values should be decoded once in a configuration service or Layer rather than read as ambient state. |
| linteffect/no-hidden-effect-execution | Direct Effect.run* calls in Effect modules outside configured boundary paths. | Reusable code should return Effects and leave runtime execution ownership at an application boundary. |
| linteffect/no-boundary-try-catch-without-effect-map | try/catch blocks in configured boundaries with no direct Effect.try, error mapping, recovery, or Effect.run* call. | Boundary failure handling should stay in Effect's typed error channel rather than becoming imperative control flow. |
The paired platform/boundary examples
cover direct and contextual runners, native filesystem forms and typed service
repairs. V4 recognises actual run*With(context)(program) execution, not factory
creation, and current Effect.catch/Cause/reason recovery. Legacy effect3
retains catchAll handling and advice. Boundary catch policy has no Effect import
gate and checks visible marker presence, not whether handling executes; unused
callbacks can suppress it. Hidden execution requires an Effect ecosystem import;
aliased runners stay opaque. Filesystem policy has no boundary exemption and
retains its function-local require gap. V3 filesystem repairs use
@effect/platform/FileSystem; v4 uses effect/FileSystem (or the root export).
No-op FileSystem Layers demonstrate the service seam, not native cancellation.
The same examples cover JSON codecs, Clock and platform services. Legacy codecs
use Schema.parseJson with Schema.decodeUnknown; v4 uses
Schema.fromJsonString with Schema.decodeUnknownEffect. Schema import presence
(including aliases and type-only imports) suppresses raw-parse warnings, but does
not establish that decoding occurred. Current clock policy includes
Effect.fnUntraced and fnUntracedEager; legacy selection preserves its existing
gap. Unused nested callbacks can still warn, while named callbacks and clock
aliases remain opaque. TestClock repairs demonstrate deterministic time rather
than renaming wall-clock access. Shared-platform policy needs no Effect import,
reports type-only Node imports, and does not inspect require; configure genuine
application boundaries or depend on typed services.
Environment examples cover direct/computed/optional reads, whole-object access,
configuration paths and typed integer providers. V3 uses Config.integer with
ConfigProvider.fromMap; v4 uses Config.Int with
ConfigProvider.fromUnknown. Both boundaryPaths and configPaths replace
defaults, and empty arrays remove exemptions. This literal-name policy needs no
Effect import: a local object named process and delete can warn, while imported
aliases, destructured process objects and compound assignments retain gaps.
Runtime controls restore their private environment keys and show that injected
configuration remains stable when ambient state changes, rejecting missing or
malformed values through Effect.
Testing, Observability, and QA
| Rule | Catches | Why |
| --- | --- | --- |
| linteffect/no-console-in-effect-flow | console.* in supported constructors and selected-major service implementations: legacy Effect.Service, current Context.Service.make. | Logging through Effect preserves the runtime's observability context. |
| linteffect/no-effect-log-without-structured-context | String-only Effect.logError/logWarning in selected-major recovery/observer callbacks and service implementations. | Failure logs need an error, structured fields, or local Effect.annotateLogs(...) context for correlation. |
| linteffect/require-span-on-public-service-method | Explicit Effect.Effect-returning exports and selected-major service methods with visible Effect returns lacking Effect.withSpan(...). | Public operations need visible trace boundaries. |
| linteffect/no-runpromise-in-non-async-test-body | Discarded direct Effect.runPromise(...) calls in *.test.*, *.spec.*, and __tests__ files. | Tests must await or return runtime execution so the framework observes completion. |
| linteffect/require-effect-flip-for-error-test | Direct await expect(Effect.runPromise(effect)).rejects... assertions in conventional test files. | An expected typed Effect failure is clearer when Effect.flip yields the error as a value for structural assertions. |
| linteffect/no-test-mock-layer-when-default-available | A direct Layer.succeed(...) or Layer.effect(...) sibling of SomeService.Default in the same Layer.provide(...) call. | An explicit default composition and a sibling replacement layer can hide which service contract the test exercises. |
These rules are deliberately syntax-only. They require an Effect ecosystem import;
they do not resolve aliases, infer Effect return types, or follow values through
variables. require-span-on-public-service-method accepts either data-first
Effect.withSpan(program, "operation") or a visible Effect call followed by
.pipe(Effect.withSpan("operation")). A pipe on an opaque receiver can still warn.
The paired observability examples
qualify current class, functional and class-expression Context.Service.make
forms, untraced constructors and current catch/Cause/reason handlers, including
literal handler maps. Select effect3.testingObservabilityAndQa to retain legacy
Effect.Service and catchAll policy. Collection remains import-order independent
and deduplicates report nodes. These are local syntax checks: unused callbacks
can warn, empty context objects satisfy logging policy, and an unexecuted
annotation can suppress it. Inferred exports and stored Effects remain opaque;
withSpan syntax does not prove that tracing is enabled. Runtime contracts verify
logger routing/annotations and spans ending once on value, failure and interruption.
Legacy tracing proxies object failures; public Cause.originalError preserves
access to the original instance. Current fixtures retain direct failure identity.
The three test-shape rules are strict opt-in checks: use
testingObservabilityAndQa when a repository follows this test style; they are
not in recommended. For an expected typed failure, the preferred pattern from
EffectPatterns service-test guidance
is to apply Effect.flip,
execute the flipped Effect, and assert the returned error's _tag, message,
and structured fields. Effect.flip moves the expected typed failure into the
success channel, making the assertion explicit. This rule deliberately matches
only a direct expect(Effect.runPromise(...)).rejects shape; ordinary
JavaScript rejection assertions, aliases, helpers, and other promise chains are
out of scope.
Configure path-sensitive rules independently when a repository uses different application and configuration boundaries:
import { defineConfig } from "oxlint";
import { platformAndBoundaryHygiene } from "@opsydyn/oxlint-effect";
export default defineConfig({
plugins: ["typescript"],
jsPlugins: [...platformAndBoundaryHygiene.jsPlugins],
rules: {
...platformAndBoundaryHygiene.rules,
"linteffect/no-node-platform-in-shared-code": [
"error",
{ boundaryPaths: ["apps/**", "server/**"] },
],
"linteffect/no-process-env-direct-read": [
"error",
{
boundaryPaths: ["apps/**", "server/**"],
configPaths: ["packages/config/**"],
},
],
"linteffect/no-hidden-effect-execution": [
"error",
{ boundaryPaths: ["apps/**", "server/**"] },
],
"linteffect/no-new-date-in-domain-logic": [
"error",
{ boundaryPaths: ["apps/**", "server/**"] },
],
"linteffect/no-boundary-try-catch-without-effect-map": [
"error",
{ boundaryPaths: ["apps/**", "server/**"] },
],
},
});Concurrency Safety
Version scope: plugin 2.2.0 and later changes the three race/shared-state
rules below for both majors. Published 2.1.x retains the
previous policy. Rule IDs, group selection and preset membership are unchanged.
These three rules now resolve actual value imports: Effect as Fx, namespace
imports from effect / effect/Effect, and named subpath operations. Direct,
curried and terminal pipe forms are supported; shadowed and type-only bindings
are excluded. This does not claim alias support for every concurrency rule.
Race warnings require visible resource-shaped acquisition without a local
cleanup owner. Pure or opaque operands do not need dummy finalizers. Cleanup on
another branch does not own an acquisition. Collection mutation warnings require
an explicit literal budget above one, global Infinity or "unbounded"; omission
and 1 are sequential and clean. Later opaque spreads/computed keys, named
budgets and legacy "inherit" remain unknown, not proven safe. Same-file lexical
ownership excludes worker-local/shadowed bindings and unexecuted callbacks.
See paired Effect 4 failures and clean controls, or the legacy failures and controls. The packed harness checks exact diagnostics, ordered values, atomic updates, first-success/first-completion semantics, and the existing loser-release contracts.
| Rule | Catches | Why |
| --- | --- | --- |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| linteffect/no-manual-deferred-coordination | V4: direct Deferred.make / makeUnsafe bindings and same-binding awaits, including captured closures. Recognises current timeout/race, interruptible/scoped and same-binding finalizer markers; supports direct/curried/terminal timeout/race forms. Legacy: function-local name matching with make / unsafeMake and old protection tables. | Strict-only completion/cancellation ownership policy. V4 distinguishes shadowed finalizer bindings and does not treat a timeout fallback callback as bounded source work. Scope, interruptibility or finalizer reference presence is not proof of execution or eventual completion; named latch aliases are not resolved. |
| linteffect/no-acquire-without-scoped-release | Resource-shaped acquisition names inside inline collection/fork/race work. V4 adds current child/detached/scoped/in forks, first-completion races, curried/terminal pipes and recognised gen/fn/logic/adapter/mapped callbacks; skips ordinary unused definitions. Legacy: old fork/race names and broad traversal. | Own actual release with acquireRelease, acquireUseRelease or registered finalizers. Existing scope and name-matched finalizer markers remain coarse exclusions, not cleanup proof: a bare scope does not release a raw resource. Naming is a heuristic; stored tasks, aliases and generic factory names are not resource-type inference. |
Scheduling/fork anti-patterns and repairs are typechecked in the
Effect 4 corpus
and legacy Effect 3 corpus.
Their runtime contracts verify ordered values, original failure identity,
bounded scheduling/retries, parent/scoped interruption, explicit detached
cleanup and race-loser resource release. Q18 adds
async/shared-state contracts
for callback adapters, ordered outcomes, cooperative loser cancellation and a
deterministic lost-update counterexample repaired with Ref.update.
Q19's cancellation/buffer contracts
advance TestClock rather than assert elapsed time, verify cooperative abort,
deferred interruption/exactly-once finalizers, and bounded FIFO/backpressure
with a live scoped PubSub subscriber. Unbounded PubSub's reported capacity is
Number.MAX_SAFE_INTEGER, not a memory-safety guarantee.
Q20's ownership/coordination contracts
prove a module-state lost update, per-execution Ref.update repair, Deferred
success/failure/interruption and timeout outcomes, and permit contention with
exactly-once release on success, failure and interruption. A scoped bare latch
is an explicit lint-clean limitation: external interruption still owns teardown.
Compiler-negative controls distinguish legacy unsafeMake(FiberId) and
Effect.Semaphore.withPermits from current makeUnsafe() and Semaphore APIs.
Legacy TSemaphore wraps Effect work, with work-first direct and semaphore-first
curried forms; it is not a current-v4 API.
Q21's ref/lifetime/acquisition contracts
verify lock contention, independent-delta repair, unchanged state on modifier
failure/interruption, detached work surviving caller completion, owned-child
teardown and resource finalization on all three exit paths. Resources are typed
stand-ins with counted release, not native filesystem/network qualification.
V4 modifySomeEffect returns Effect<[result, Option<state>]>; legacy takes a
fallback and Option<Effect<[result, state]>>. Both no-update branches preserve
state and result. Do not mechanically port the optional modifier's signature.
The allocated concurrency and resource-lifetime batches and cross-group
composition are locally qualified for the documented forms.
V4 fiber observation and shared-state checks use Oxlint's
lexical scope metadata, not TypeScript type inference; they do not require
typeAware or enable compiler diagnostics.
Qualification uses completion markers and a 60-second deadlock watchdog, not
timing-based behavioural assertions. Qualification remains scoped to the
documented calling forms and pinned pa
