Skip to content

Extend effect-complexity to flag useLayoutEffect and useInsertionEffect #15

@ColumbusLabs

Description

@ColumbusLabs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomersgood-first-ruleStarter work for adding or improving a DebtLens rulehelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions