Effect-TS / eslint-plugin

A set of ESlint and TypeScript rules to work with Effect
MIT License
15 stars 1 forks source link

`consistent-tap` rule #19

Open leighman opened 1 week ago

leighman commented 1 week ago

What is the problem this feature would solve?

Effect.tap allows more that Effect as the return type which is inconsistent with other tap functions.

What is the feature you are proposing to solve the problem?

This rule could either use type information to assert that tap always takes a function that returns an effect or potentially could enforce that uses of tap include an onlyEffect: true option in the arguments (wouldn't require type info?)

What alternatives have you considered?

Encountered this by accidentally providing a (args) => TaskEither<A, E> function to tap. Could just be more careful...