Goal
effect-complexity only inspects useEffect call expressions today. Layout and insertion effects can carry the same maintainability debt but are silently skipped.
Where to start
src/detectors/effectComplexity.ts
tests/detectors/effectComplexity.test.ts
docs/rules.md (effect-complexity section)
Suggested approach
- Treat
useLayoutEffect and useInsertionEffect with the same line/branch/dependency thresholds as useEffect.
- Keep severity and messaging consistent; mention the hook name in the issue message.
Verify
- Fixture where a long
useLayoutEffect fires.
- Fixture where a small
useInsertionEffect does not fire.
- Existing
useEffect tests still pass unchanged.
Goal
effect-complexityonly inspectsuseEffectcall expressions today. Layout and insertion effects can carry the same maintainability debt but are silently skipped.Where to start
src/detectors/effectComplexity.tstests/detectors/effectComplexity.test.tsdocs/rules.md(effect-complexitysection)Suggested approach
useLayoutEffectanduseInsertionEffectwith the same line/branch/dependency thresholds asuseEffect.Verify
useLayoutEffectfires.useInsertionEffectdoes not fire.useEffecttests still pass unchanged.