Skip to content

Rule to enforce the "use client" header when a hook is used in the module #3918

Open
@FezVrasta

Description

@FezVrasta

It would be helpful to have a rule that enforces to set "use client" when inside the file/module a React hook is used.

This would help prevent cases where a component that was only imported by a "use client" one starts being imported also by a "use server" one and accidentally breaks the page.

I guess the existing hook-detection logic the library uses for other rules would suffice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions