nonObjectEffectServiceType

August 4, 2026 ยท View on GitHub

Ensures Effect.Service types are objects, not primitives

PropertyValue
CategoryCorrectness
Default severityerror
FixableNo
Effect versionsv3
Diagnostic codesTS377048
Language Service namenonObjectEffectServiceType
Oxlint nameeffecttsgo/non-object-effect-service-type

Preview

import * as Effect from "effect/Effect"

export class BadService extends Effect.Service<BadService>()("BadService", {
  // @ts-expect-error
  succeed: "hello" as const
/**
  ^^^^^^^ effecttsgo(non-object-effect-service-type): `Effect.Service` is declared with a primitive service type. `Effect.Service` models object-shaped services; primitive values use `Context.Tag` or `Effect.Tag` directly.
*/
}) {}

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": {
          "nonObjectEffectServiceType": "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/non-object-effect-service-type": "warn"
  }
}