use client Overuse
"use client" on files that don't use any client-side APIs
infoAI Quality
use-client-overuseWhy this matters
AI tools add 'use client' as a fix for any error, even when the component doesn't need client-side features. This unnecessarily increases your JavaScript bundle and disables server-side rendering.
Example
components/user-card.tsx"use client";
// Nothing here needs the browser: no state, no effects, no handlers
export function UserCard({ name, email }: Props) {
return (
<div>
<h3>{name}</h3>
<p>{email}</p>
</div>
);
}components/user-card.tsx// No "use client" — this is a server component
export function UserCard({ name, email }: Props) {
return (
<div>
<h3>{name}</h3>
<p>{email}</p>
</div>
);
}How to fix
Remove 'use client' from components that don't use hooks (useState, useEffect), event handlers (onClick), or browser APIs (window, document). Let them render on the server.
Reference
- In the output
- Findings carry
"ruleId": "use-client-overuse"in--jsonand the same id in SARIF and in the terminal. - Silence one line
// prodlint-disable-next-line use-client-overuse- Silence a whole file
// prodlint-disable use-client-overuseat the top of the file- How it works
- Matches text patterns. Source on GitHub