Warns when using error handling on Effects that never fail
| Property | Value |
|---|---|
| Category | Anti-pattern |
| Default severity | suggestion |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377009 |
| Language Service name | catchUnfailableEffect |
| Oxlint name | effecttsgo/catch-unfailable-effect |
import { Effect } from "effect"
export const preview = Effect.succeed(1).pipe(
Effect.catch(() => Effect.succeed(0))
/**
^^^^^^^^^^^^ effecttsgo(catch-unfailable-effect): The previous Effect does not fail, so this error-handling branch will never run.
*/
)See the Language Service setup guide for installation instructions.
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/catch-unfailable-effect": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "catchUnfailableEffect": "warning" } } ] } }