Detects Layer values with unhandled context requirements
| Property | Value |
|---|---|
| Category | Correctness |
| Default severity | error |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377034 |
| Language Service name | missingLayerContext |
| Oxlint name | effecttsgo/missing-layer-context |
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.
*/See the Language Service setup guide for installation instructions.
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"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "missingLayerContext": "warning" } } ] } }