unnecessaryEffectGen

August 4, 2026 ยท View on GitHub

Suggests removing Effect.gen when it contains only a single return statement

PropertyValue
CategoryStyle
Default severitysuggestion
FixableYes
Effect versionsv3, v4
Diagnostic codesTS377017
Language Service nameunnecessaryEffectGen
Oxlint nameeffecttsgo/unnecessary-effect-gen

Preview

import * as Effect from "effect/Effect"

export const preview = Effect.gen(function*() {
/**
                       ^^^^^^^^^^^^^^^^^^^^^^^^ effecttsgo(unnecessary-effect-gen): This Effect.gen contains a single return statement.
*/
  return yield* Effect.succeed(1)
/**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*/
})
/**
^^
*/

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": {
          "unnecessaryEffectGen": "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/unnecessary-effect-gen": "warn"
  }
}