nestedEffectGenYield

August 4, 2026 ยท View on GitHub

Warns when yielding a nested bare Effect.gen inside an existing Effect generator context

PropertyValue
CategoryStyle
Default severityoff
FixableNo
Effect versionsv3, v4
Diagnostic codesTS377083
Language Service namenestedEffectGenYield
Oxlint nameeffecttsgo/nested-effect-gen-yield

Preview

import { Effect } from "effect"

export const preview = Effect.gen(function*() {
	yield* Effect.gen(function*() {
/**
	       ^^^^^^^^^^^^^^^^^^^^^^^^ effecttsgo(nested-effect-gen-yield): This `yield*` is applied to a nested `Effect.gen(...)` that can be inlined in the parent Effect generator context.
*/
		return 1
/**
^^^^^^^^^^
*/
	})
/**
^^^
*/
})

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": {
          "nestedEffectGenYield": "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/nested-effect-gen-yield": "warn"
  }
}