unnecessaryFailYieldableError

August 4, 2026 ยท View on GitHub

Suggests yielding yieldable errors directly instead of wrapping with Effect.fail

PropertyValue
CategoryStyle
Default severitysuggestion
FixableYes
Effect versionsv3, v4
Diagnostic codesTS377019
Language Service nameunnecessaryFailYieldableError
Oxlint nameeffecttsgo/unnecessary-fail-yieldable-error

Preview

import * as Data from "effect/Data"
import * as Effect from "effect/Effect"

class Boom extends Data.TaggedError("Boom")<{}> {}
export const preview = Effect.gen(function*() {
  yield* Effect.fail(new Boom())
/**
  ^^^^^ effecttsgo(unnecessary-fail-yieldable-error): This `yield* Effect.fail(...)` passes a yieldable error value. `yield*` represents that value directly without wrapping it in `Effect.fail`.
*/
})

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": {
          "unnecessaryFailYieldableError": "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/unnecessary-fail-yieldable-error": "warn"
  }
}