effector / effector/eslint-plugin
Rule: `no-effects-in-components`
Open
enhancement
- Dominant language
- TypeScript
- Stars
- 94
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
Using effects in components typically leads to business logic leaks into view. A cleaner approach is to use events instead of effects.
I suggest to add corresponding rule to warn a user about it.
```ts
// Fail
function Component() {
useUnit(someFx)
useEvent(someFx)
useEffect(() => {
someFx()
() => someFx()
}, [])
const callback = () => {
someFx()
}
useCallback(() => {
someFx()
}, [])
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.