multipleEffectProvide
August 4, 2026 ยท View on GitHub
Warns against chaining Effect.provide calls which can cause service lifecycle issues
| Property | Value |
|---|---|
| Category | Anti-pattern |
| Default severity | warning |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377033 |
| Language Service name | multipleEffectProvide |
| Oxlint name | effecttsgo/multiple-effect-provide |
Preview
import { Effect, Layer, Context } from "effect"
class A extends Context.Service<A>()("A", { make: Effect.succeed({}) }) {
static Default = Layer.effect(this, this.make)
}
class B extends Context.Service<B>()("B", { make: Effect.succeed({}) }) {
static Default = Layer.effect(this, this.make)
}
export const preview = Effect.void.pipe(Effect.provide(A.Default), Effect.provide(B.Default))
/**
^^^^^^^^^^^^^^^^^^^^^^^^^ effecttsgo(multiple-effect-provide): This expression chains multiple `Effect.provide` calls. Providing Layers in multiple calls in a chain can break service lifecycle behavior compared with a single combined provide with merged layers.
*/
Language Service Configuration
See the Language Service setup guide for installation instructions.
{
"$schema": "./node_modules/@effect/tsgo/schema.json",
"compilerOptions": {
"plugins": [
{
"name": "@effect/language-service",
"diagnosticSeverity": {
"multipleEffectProvide": "warning"
}
}
]
}
}
Oxlint Configuration
See the Oxlint setup guide for installation and patching instructions.
{
"$schema": "./node_modules/@effect/tsgo/oxlint-schema.json",
"options": {
"typeAware": true
},
"plugins": ["effecttsgo"],
"rules": {
"effecttsgo/multiple-effect-provide": "warn"
}
}