Suggests Effect.tapError for catch handlers that sequence an effect and then re-fail the original error
| Property | Value |
|---|---|
| Category | Style |
| Default severity | suggestion |
| Fixable | No |
| Effect versions | v4 |
| Diagnostic codes | TS377133 |
| Language Service name | catchRefailToTapError |
| Oxlint name | effecttsgo/catch-refail-to-tap-error |
import { Effect } from "effect"
declare const save: Effect.Effect<void, Error>
declare const rollback: Effect.Effect<void>
export const program = save.pipe(
Effect.catch(error => rollback.pipe(Effect.andThen(Effect.fail(error))))
/**
^^^^^^^^^^^^ effecttsgo(catch-refail-to-tap-error): Use Effect.tapError to observe the error and preserve the original failure without having to re-fail it.
*/
)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-refail-to-tap-error": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "catchRefailToTapError": "warning" } } ] } }