Skip to content

Latest commit

 

History

History
66 lines (54 loc) · 1.56 KB

missing-star-in-yield-effect-gen.md

File metadata and controls

66 lines (54 loc) · 1.56 KB

missingStarInYieldEffectGen

Detects bare yield (without *) inside Effect generator scopes

Property Value
Category Correctness
Default severity error
Fixable Yes
Effect versions v3, v4
Diagnostic codes TS377007, TS377008
Language Service name missingStarInYieldEffectGen
Oxlint name effecttsgo/missing-star-in-yield-effect-gen

Preview

import * as Effect from "effect/Effect"

export const preview = Effect.gen(function*() {
  const value = yield Effect.succeed(1)
/**
                ^^^^^ effecttsgo(missing-star-in-yield-effect-gen): This uses `yield` for an `Effect` value. `yield*` is the Effect-aware form in this context.
*/
  return value
})

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": {
          "missingStarInYieldEffectGen": "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-star-in-yield-effect-gen": "warn"
  }
}