Skip to main content
Correctness diagnostics flag code that is structurally invalid or likely to cause runtime bugs. Most are errors by default and block compilation when an Effect type is misused.
Rules marked ❌ are errors by default. Rules marked ⚠️ are warnings. Rules marked βž– are off by default and must be enabled in diagnosticSeverity.

anyUnknownInErrorContext

Severity: βž– off by default Β Β·Β  V3/V4: βœ“ / βœ“ Detects any or unknown types in the error (E) or requirements (R) channels of an Effect. These imprecise types defeat the purpose of Effect’s typed error and dependency channels. Enable this rule to enforce fully typed channels across your codebase.
To enable:

classSelfMismatch

Severity: ❌ error Β Β·Β  Fix: πŸ”§ Β Β·Β  V3/V4: βœ“ / βœ“ Ensures that the Self type parameter passed to Effect.Service, Effect.Tag, ServiceMap.Service, or Schema class constructors matches the class name. A mismatch breaks the service identity used internally by the Context system.
The quick fix updates the type argument to match the class name automatically.

duplicatePackage

Severity: ⚠️ warning Β Β·Β  V3/V4: βœ“ / βœ“ Warns when multiple versions of an Effect-related package are present in the program’s dependency graph. Duplicate packages cause services to have different identities in each copy, breaking Context lookups silently.
If a duplicate is intentional (for example during a migration), add the package to allowedDuplicatedPackages:

effectFnImplicitAny

Severity: ❌ error Β Β·Β  V3/V4: βœ“ / βœ“ Mirrors TypeScript’s noImplicitAny check for parameters inside Effect.fn, Effect.fnUntraced, and Effect.fnUntracedEager callbacks when no outer contextual function type provides the annotation. Requires noImplicitAny: true in tsconfig.json.

floatingEffect

Severity: ❌ error Β Β·Β  V3/V4: βœ“ / βœ“ Detects Effect values that are created as standalone expression statements β€” neither yielded inside a generator nor assigned to a variable. A floating Effect is never executed and indicates a missing yield* or assignment.

genericEffectServices

Severity: ⚠️ warning Β Β·Β  V3/V4: βœ“ / βœ“ Prevents defining Effect.Service or Effect.Tag classes with type parameters. Generic services cannot be discriminated at runtime because different instantiations share the same tag identifier, leading to unexpected behavior when looking up services from Context.

missingEffectContext

Severity: ❌ error Β Β·Β  V3/V4: βœ“ / βœ“ Detects Effect values whose requirements channel (R) contains services that have not been provided. This is analogous to a missing import β€” the effect cannot run without those services.

missingEffectError

Severity: ❌ error Β Β·Β  Fix: πŸ”§ Β Β·Β  V3/V4: βœ“ / βœ“ Detects Effect values whose error channel (E) contains error types that are not handled by the type expected at that position. This flags type-level mismatches where errors leak through unhandled.
The quick fix adds the missing error types to the expected type.

missingLayerContext

Severity: ❌ error Β Β·Β  V3/V4: βœ“ / βœ“ Detects Layer values whose input requirements (RIn) contain services that are not satisfied by the composed layers. Similar to missingEffectContext but for the layer graph.

missingReturnYieldStar

Severity: ❌ error Β Β·Β  Fix: πŸ”§ Β Β·Β  V3/V4: βœ“ / βœ“ Suggests using return yield* for Effects that never succeed (success type is never). Using return yield* instead of just yield* signals a definitive exit point, improving type narrowing and tooling support for exhaustive pattern matching.

missingStarInYieldEffectGen

Severity: ❌ error Β Β·Β  Fix: πŸ”§ Β Β·Β  V3/V4: βœ“ / βœ“ Detects bare yield (without *) inside Effect generator scopes. Inside Effect.gen, you must always use yield* to unwrap an Effect. Using yield without * returns the raw Effect object rather than executing it.

nonObjectEffectServiceType

Severity: ❌ error Β Β·Β  V3 only Β Β·Β  V4: β€” Ensures that the service type in Effect.Service is an object type ({}) and not a primitive. Effect’s Context system requires object types to safely attach tag metadata. This rule is V3-only because V4’s ServiceMap.Service handles primitives differently.

outdatedApi

Severity: ⚠️ warning Β Β·Β  V3: β€” Β Β·Β  V4 only Detects usage of APIs that were removed or renamed in Effect V4. The diagnostic message includes the V3 API that was used and guidance on the V4 replacement. This rule is only active when the language service detects an Effect V4 project.

overriddenSchemaConstructor

Severity: ❌ error Β Β·Β  Fix: πŸ”§ Β Β·Β  V3/V4: βœ“ / βœ“ Prevents overriding the constructor in classes that extend a Schema class (Schema.Class, Schema.TaggedClass, Schema.TaggedError, etc.). Overriding the constructor silently breaks the schema’s decoding behaviour. Use a static factory method instead.
The quick fix removes the constructor override and replaces it with a static new method.