anyUnknownInErrorContext

August 4, 2026 ยท View on GitHub

Detects 'any' or 'unknown' types in Effect error or requirements channels

PropertyValue
CategoryCorrectness
Default severityoff
FixableNo
Effect versionsv3, v4
Diagnostic codesTS377030
Language Service nameanyUnknownInErrorContext
Oxlint nameeffecttsgo/any-unknown-in-error-context

Preview

import { Effect } from "effect"

export const preview = Effect.gen(function*() {
/**
             ^^^^^^^ effecttsgo(any-unknown-in-error-context): This has unknown in the requirements channel and any in the error channel which is not recommended. Only service identifiers should appear in the requirements channel. Having an unknown or any error type is not useful. Consider instead using specific error types baked by Data.TaggedError for example.
*/
  yield* Effect.context<unknown>()
/**
         ^^^^^^^^^^^^^^^^^^^^^^^^^ effecttsgo(any-unknown-in-error-context): This has unknown in the requirements channel which is not recommended. Only service identifiers should appear in the requirements channel.
*/
  return yield* Effect.fail<any>("boom")
/**
                ^^^^^^^^^^^^^^^^^^^^^^^^ effecttsgo(any-unknown-in-error-context): This has any in the error channel which is not recommended. Having an unknown or any error type is not useful. Consider instead using specific error types baked by Data.TaggedError for example.
*/
})

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": {
          "anyUnknownInErrorContext": "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/any-unknown-in-error-context": "warn"
  }
}