unknownInEffectCatch

August 4, 2026 ยท View on GitHub

Warns when catch callbacks return unknown instead of typed errors

PropertyValue
CategoryAnti-pattern
Default severitywarning
FixableNo
Effect versionsv3, v4
Diagnostic codesTS377021
Language Service nameunknownInEffectCatch
Oxlint nameeffecttsgo/unknown-in-effect-catch

Preview

import { Effect } from "effect"

export const preview = Effect.tryPromise({
/**
                       ^^^^^^^^^^^^^^^^^ effecttsgo(unknown-in-effect-catch): The `catch` callback in `Effect.tryPromise` returns `unknown`, so the Effect error type stays untyped. A specific typed error preserves error-channel information, for example by narrowing the value or wrapping it in `Data.TaggedError`.
*/
  try: async () => 1,
  catch: (error) => 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": {
          "unknownInEffectCatch": "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/unknown-in-effect-catch": "warn"
  }
}