nonObjectEffectServiceType
August 4, 2026 ยท View on GitHub
Ensures Effect.Service types are objects, not primitives
| Property | Value |
|---|---|
| Category | Correctness |
| Default severity | error |
| Fixable | No |
| Effect versions | v3 |
| Diagnostic codes | TS377048 |
| Language Service name | nonObjectEffectServiceType |
| Oxlint name | effecttsgo/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"
}
}