effectInFailure

August 4, 2026 ยท View on GitHub

Warns when an Effect is used inside an Effect failure channel

PropertyValue
CategoryAnti-pattern
Default severitywarning
FixableNo
Effect versionsv3, v4
Diagnostic codesTS377054
Language Service nameeffectInFailure
Oxlint nameeffecttsgo/effect-in-failure

Preview

import { Effect } from "effect"

export const preview = Effect.try({
/**
             ^^^^^^^ effecttsgo(effect-in-failure): The error channel contains an Effect (Effect<void, never, never>). Putting Effect computations in the failure channel is not intended; keep only failure types there.
*/
/**
                       ^^^^^^^^^^^^
*/
  try: () => JSON.parse("{"),
/**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*/
  catch: (error) => Effect.logError(error)
/**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*/
})
/**
^^
*/

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": {
          "effectInFailure": "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/effect-in-failure": "warn"
  }
}