Suggests yielding into a const before a call instead of passing a yield* directly as a call or new argument in Effect generators
| Property | Value |
|---|---|
| Category | Style |
| Default severity | off |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377171 |
| Language Service name | yieldInCallArgument |
| Oxlint name | effecttsgo/yield-in-call-argument |
import { Effect } from "effect"
declare const load: Effect.Effect<number>
declare function transform(n: number): string
export const preview = Effect.gen(function*() {
const result = transform(yield* load)
/**
^^^^^ effecttsgo(yield-in-call-argument): This `yield*` is used as a call argument; yield it into a const first, or map the effect, so running the effect and building the call stay separate steps.
*/
return result
})See the Language Service setup guide for installation instructions.
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/yield-in-call-argument": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "yieldInCallArgument": "warning" } } ] } }