Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
FezVrasta opened this issue Apr 29, 2025 · 0 comments
Open

Comments

@FezVrasta
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant