Warns when yielding a nested bare Effect.gen inside an existing Effect generator context
| Property | Value |
|---|---|
| Category | Style |
| Default severity | off |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377083 |
| Language Service name | nestedEffectGenYield |
| Oxlint name | effecttsgo/nested-effect-gen-yield |
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
/**
^^^^^^^^^^
*/
})
/**
^^^
*/
})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/nested-effect-gen-yield": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "nestedEffectGenYield": "warning" } } ] } }