Skip to content

Latest commit

 

History

History
73 lines (61 loc) · 1.57 KB

nested-effect-gen-yield.md

File metadata and controls

73 lines (61 loc) · 1.57 KB

nestedEffectGenYield

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

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"
  }
}