You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one probably can't be done, but I'm curious if anyone has any thoughts - can we lint against module side effects?
Only way I've thought of so far is to lint specifically against fp-ts and enforce that you can't call Task or IO functions in a module except within another function.
The text was updated successfully, but these errors were encountered:
I believe if you are using the rule no-expression-statement, this will prevent module side effects unless the side effect happens as a result of a function call.
If it becomes possible to ensure a function is pure in typescript then this could also be prevented.
Yes, having a pure modifier for functions in typescript would be awesome :-).
I usually try to avoid having any code outside of functions in all modules. Having side-effects happen just by importing a module is IMO never wanted. Perhaps we could check if there is anything else than function definitions in a module? That check would be less specific of course but it would eliminate any side-effect that happen on import. Or would that be too restrictive?
This one probably can't be done, but I'm curious if anyone has any thoughts - can we lint against module side effects?
Only way I've thought of so far is to lint specifically against
fp-ts
and enforce that you can't callTask
orIO
functions in a module except within another function.The text was updated successfully, but these errors were encountered: