@noctcore/eslint-plugin-react
A bad fit if your codebase keeps hooks inline by convention, or if you are linting a library of generic primitives where wide prop surfaces are the point.
React architecture and correctness: prop drilling, state colocation, memoized context values, effect safety.
What it solves
Section titled “What it solves”React components that compile, render, and still rot: a props bundle forwarded unchanged through three layers, state and effects written inline in the .tsx, a context value that is a fresh object every render, a setState that lands after the component unmounted. TypeScript and eslint-plugin-react-hooks see none of these, because each is a structural decision rather than a type or hook-order error.
What it will yell at you about
Section titled “What it will yell at you about”It will yell at you about where code lives as much as what it does. no-state-in-component-body wants state and effects in a colocated <Name>.hooks.ts, max-props-per-component and max-hook-return-surface cap how wide a component or hook is allowed to get, and props-must-be-visual rejects identity props like userId on presentational components. That is a deliberate architecture: containers own data, components render it. It is a bad fit if your codebase keeps hooks inline by convention, or if you are linting a library of generic primitives where wide prop surfaces are the point. Start with the correctness half (context-value-must-be-memoized, require-effect-cancellation, no-effect-derived-state) and switch the structural rules off rather than living with a wall of reports.
Install and configure
Section titled “Install and configure”npm install --save-dev @noctcore/eslint-plugin-react @typescript-eslint/parser# or: bun add -D / pnpm add -D @noctcore/eslint-plugin-react @typescript-eslint/parserThe recommended preset enables 9 of 18 rules. The strict preset adds 7 house rules (naming, folder shape, size caps) on top. The rules board below builds the flat config: start from a preset, switch single rules between error and off, and copy the result.
Each rule links to its page, with the options it takes and Incorrect and Correct examples. A good first
read is no-prop-drilling.
--fixsuggestionsneeds optionstype infoEach switch sets a rule to error or off.
<Component>Props. Autofixes by renaming the in-file type declaration and its references when that is safe.value must not be an inline object, array or function: a fresh reference each render re-renders every consumer. Memoize it with useMemo / useCallback and pass the stable reference.use* hook in a hook file may return object literals (top-level or nested one level) of at most max (default 20) members. Wider returns are god-controllers in the making.*.hooks.ts / *.queries.ts / *.mutations.ts) may export at most max (default 4) use* hooks. Split larger files.*Props interface/type-literal may declare at most max (default 12) local members. extends clauses are not counted.use* hook in a hook file may keep at most max (default 4) useState / useReducer slots, and a function inside it may call at most maxSettersPerFunction (default 3) distinct setters. Group the rest in a reducer.setState calls with values derived purely from its dependencies is the "you might not need an effect" anti-pattern — compute the value during render (or with useMemo) instead.{...}. Lift them to a const above the return or into the hook.use*-named function must not return JSX — that is a component wearing a hook costume. Rename it to a PascalCase component, or return values instead of elements.type="date" and friends): Chromium formats them in the browser UI language and ignores lang, so the date order can contradict the page.maxForwarded+ (default 4) props each forwarded unchanged (name={name}) from the *Props param to the same child component is prop drilling. Compose instead.<Name>.hooks.ts), not in the component .tsx body. The component is a thin shell.localStorage / sessionStorage access must sit inside a try with a catch: the access itself throws when storage is disabled, partitioned or full.autoComplete purpose, so a password manager can fill the current password and save a new one.useState initializer that is an expensive call (default JSON.parse / localStorage.getItem / sessionStorage.getItem, or a configured builder) must be wrapped in a function so it runs once on mount, not every render.userId, currentUser, *token*, *jwt*, *secret*, apiKey, ...) are disallowed. A live password input is a legitimate visual concern and is intentionally allowed.setState/dispatch that runs after an await or .then() inside a useEffect must be guarded against a unmounted/re-run effect (AbortController, a cancelled flag, or a cleanup return).