effect-app / libs

The core libraries to build apps with Effect
44 stars 6 forks source link

ESlint plugin: Dangling effects #98

Open patroza opened 6 days ago

patroza commented 6 days 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 })