runEffectInsideEffect

August 4, 2026 ยท View on GitHub

Suggests using Runtime or Effect.runWith methods instead of Effect.run inside Effect contexts

PropertyValue
CategoryAnti-pattern
Default severitysuggestion
FixableYes
Effect versionsv3, v4
Diagnostic codesTS377024, TS377025, TS377074
Language Service namerunEffectInsideEffect
Oxlint nameeffecttsgo/run-effect-inside-effect

Preview

import { Effect } from "effect"

export const preview = Effect.gen(function*() {
  const run = () => Effect.runSync(Effect.succeed(1))
/**
                    ^^^^^^^^^^^^^^ effecttsgo(run-effect-inside-effect): `Effect.runSync` is called inside an Effect with a separate services invocation. In this context, child Effects run with the surrounding services, which can be accessed through `Effect.context` and `Effect.runSyncWith`.
*/
  return run()
})

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": {
          "runEffectInsideEffect": "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/run-effect-inside-effect": "warn"
  }
}