effectInFailure
August 4, 2026 ยท View on GitHub
Warns when an Effect is used inside an Effect failure channel
| Property | Value |
|---|---|
| Category | Anti-pattern |
| Default severity | warning |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377054 |
| Language Service name | effectInFailure |
| Oxlint name | effecttsgo/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"
}
}