effect-app / libs

The core libraries to build apps with Effect
45 stars 7 forks source link

ESlint plugin: Dangling effects #98

Open patroza opened 3 weeks ago

patroza commented 3 weeks ago

Bad: Effect.gen(function* () { Effect.succeed(1) }) Effect.gen(function* () { return Effect.succeed(1) }) Effect.gen(function* () { const a = Effect.succeed(1); return a }) Effect.gen(function* () { const a = Effect.succeed(1) }) // wishful thinking, would require deep knowledge

Good: Effect.gen(function* () { yield* Effect.succeed(1) }) Effect.gen(function* () { return yield* Effect.succeed(1) }) Effect.gen(function* () { const a = Effect.succeed(1); return yield* a })