You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Warn about unnecessary 'use client' directives in files without client-side features. This would make it easier for teams to move towards RSC more and more.
Require the 'use client' directive in files with client-side features. Instead of encountering a runtim error (which could be missed after code changes), the lint rule would error on files that clearly need the 'use client' directive.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Warn about unnecessary 'use client' directives in files without client-side features. This would make it easier for teams to move towards RSC more and more.
Require the 'use client' directive in files with client-side features. Instead of encountering a runtim error (which could be missed after code changes), the lint rule would error on files that clearly need the 'use client' directive.
Non-Goals
No response
Background
There are a handful of inofficial repositories like https://www.npmjs.com/package/@serviceup/eslint-plugin-enforce-use-client, https://github.com/roginfarrer/eslint-plugin-react-server-components or https://github.com/Frozies/next-no-use-client-page that try to solve some of the functionality.
It would be better to have an official lint rule provided by the Next.js team though.
Proposal
Get inspiration from the repositories mentioned above.
Beta Was this translation helpful? Give feedback.
All reactions