unnecessaryEffectGen
August 4, 2026 ยท View on GitHub
Suggests removing Effect.gen when it contains only a single return statement
| Property | Value |
|---|---|
| Category | Style |
| Default severity | suggestion |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377017 |
| Language Service name | unnecessaryEffectGen |
| Oxlint name | effecttsgo/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"
}
}