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
I've discussed this rule in the effector's chat, and many people voiced their concerns that this rule is not entirely worth implementing.
Simple cases like forward({ from: submit, to: submit }); are easy to detect at the early stages.
Not all cases can lead to a cycle, for example sample({ clock: foo, filter, fn, target: foo })
Some cases are really hard to detect, for example
constfoo=createEvent();const$bar=createStore("bar");constfoobar=sample({clock: foo,source: $bar})// somewhere in another modulesample({clock: foobar,target: foo})
Original example (which I saw in real codebase) in the issue is definitely a buggy code, and we can detect it statically.
forward({from: submit,to: submit});
Why should we remove this rule? Of course, it cannot detect any bug, as well as any other rule. For me, it is not a reason to remove the whole rule.
This plugin does not aim to fix only "smart" bugs, it is trying to help developers introduce fewer bugs. So, this rule would help to find "stupid" bug earlier, event before build.
I've found a code in some codebases like this:
Of course, it leads to bug. We can detect such cases in linter.
The text was updated successfully, but these errors were encountered: