missingLayerContext

August 4, 2026 ยท View on GitHub

Detects Layer values with unhandled context requirements

PropertyValue
CategoryCorrectness
Default severityerror
FixableNo
Effect versionsv3, v4
Diagnostic codesTS377034
Language Service namemissingLayerContext
Oxlint nameeffecttsgo/missing-layer-context

Preview

import { Effect, Layer, Context } from "effect"

class A extends Context.Service<A>()("A", { make: Effect.succeed({}) }) {
  static Default = Layer.effect(this, this.make)
}
declare const layer: Layer.Layer<A, never, A>
// @ts-expect-error
export const preview: Layer.Layer<A> = layer
/**
             ^^^^^^^ effecttsgo(missing-layer-context): Missing 'A' in the expected Layer context.
*/

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": {
          "missingLayerContext": "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/missing-layer-context": "warn"
  }
}