Skip to main content
Style diagnostics suggest code improvements that make Effect code more idiomatic, concise, and consistent. Most include a quick fix (πŸ”§) so the improvement is one keystroke away. All are suggestions or off by default β€” they never block compilation.
Rules marked πŸ’‘ are suggestions. Rules marked βž– are off by default and must be enabled in diagnosticSeverity.
V3/V4: βœ“ / βœ“Suggests using Effect.mapError instead of the pattern Effect.catchAll(e => Effect.fail(transform(e))). When you only need to transform the error type without recovering, mapError is the idiomatic choice.
V3/V4: βœ“ / βœ“Enforces deterministic, file-path-based naming for service identifiers, tag identifiers, and error tag strings. Consistent key naming prevents accidental collisions when the same identifier is used in different files. Configure the naming formula with keyPatterns in the plugin options.
To enable:
V3/V4: βœ“ / βœ“Suggests wrapping functions that return an Effect with Effect.fn to get automatic tracing, span naming, and a cleaner call signature. Applies to function declarations and arrow functions at module scope.
V3/V4: βœ“ / βœ“Suggests using Effect.asVoid instead of Effect.map(() => void 0), Effect.map(() => undefined), or Effect.map(() => {}). Effect.asVoid is the idiomatic way to discard a success value.
V3/V4: βœ“ / βœ“Suggests using Effect.void instead of Effect.succeed(undefined) or Effect.succeed(void 0). Effect.void is the canonical empty-success value.
V3/V4: βœ“ / βœ“Suggests converting deeply nested function calls to .pipe() style for better readability. Triggers when at least pipeableMinArgCount (default: 2) contiguous pipeable transformations are nested.
To enable:
V3 only Β Β·Β  V4: β€”Checks that an Effect.Service class’s declared dependencies array satisfies all required layer inputs. If a service’s implementation requires another service but that service is not listed in dependencies, the layer will be incomplete.
To enable:
V3/V4: βœ“ / βœ“Suggests removing the redundant identifier argument from Schema.TaggedClass, Schema.TaggedError, and Schema.TaggedRequest when the identifier is the same as the class name. The class name is used by default, so passing it explicitly is noise.
V3/V4: βœ“ / βœ“Suggests replacing Schema.Struct with a _tag field with Schema.TaggedStruct. Schema.TaggedStruct makes the _tag field optional in the constructor (it defaults to the tag value), reducing boilerplate.
V3 only Β Β·Β  V4: β€”Suggests combining multiple Schema.Literal calls inside a Schema.Union into a single Schema.Literal call. A single Schema.Literal with multiple arguments is equivalent and more concise.
To enable:
V4 only Β Β·Β  V3: β€”Warns when ServiceMap.Service is used as a variable expression instead of a class declaration. The class declaration form is the idiomatic V4 pattern and enables better type inference, tooling support, and accessor generation.
To enable:
V3/V4: βœ“ / βœ“Enforces that only strictly boolean values are used in conditional expressions. Disallows truthy/falsy coercion of strings, numbers, null, and undefined in conditions. Mirrors TypeScript’s strictNullChecks spirit for conditionals.
To enable:
V3/V4: βœ“ / βœ“Suggests removing the Effect.gen wrapper when the generator body contains only a single return statement. A single-expression generator adds indentation and function* syntax with no benefit.
V3/V4: βœ“ / βœ“Suggests yielding yieldable error types (such as Data.TaggedError instances) directly with yield* instead of wrapping them in Effect.fail. Tagged errors implement the Yieldable interface, so they can be yielded directly for a more concise syntax.
V3/V4: βœ“ / βœ“Removes pipe() calls that contain no arguments. An empty pipe() call is a no-op and should be removed.
V3/V4: βœ“ / βœ“Simplifies chained pipe calls into a single pipe call. When multiple pipe(...) calls are chained, they can always be flattened into one, improving readability.