Skip to main content
React Doctor includes 60+ specialized rules across 10 categories to catch React performance issues, architectural problems, and framework-specific bugs.

Rule Categories

State and Effects

9 rules for proper state management and effect usage

Performance

10 rules for React rendering and animation performance

Architecture

4 rules for component structure and code organization

Bundle Size

6 rules for reducing JavaScript bundle size

Security

2 rules for preventing security vulnerabilities

Correctness

3 rules for common React mistakes and bugs

Accessibility

15 rules from jsx-a11y for accessible UIs

Next.js

16 Next.js-specific optimization and correctness rules

React Native

8 React Native and Expo best practices

Dead Code

Unused files, exports, types via Knip integration

All Rules by Category

State and Effects (9 rules)

RuleSeverityDescription
react-doctor/no-derived-state-effecterrorDetects state derived from props in useEffect
react-doctor/no-fetch-in-effecterrorPrevents fetch() inside useEffect
react-doctor/no-cascading-set-statewarnFlags 3+ setState calls in one effect
react-doctor/no-effect-event-handlerwarnDetects useEffect simulating event handlers
react-doctor/no-derived-useStatewarnCatches useState initialized from props
react-doctor/prefer-useReducerwarnSuggests useReducer for 5+ related useState calls
react-doctor/rerender-lazy-state-initwarnEnforces lazy initialization for expensive computations
react-doctor/rerender-functional-setstatewarnRequires functional updates to avoid stale closures
react-doctor/rerender-dependencieserrorCatches new object/array references in dependency arrays

Performance (10 rules)

RuleSeverityDescription
react-doctor/no-inline-prop-on-memo-componentwarnPrevents inline props breaking memo()
react-doctor/no-usememo-simple-expressionwarnFlags useMemo wrapping trivial expressions
react-doctor/no-layout-property-animationerrorPrevents animating layout-triggering properties
react-doctor/no-transition-allwarnFlags transition: “all” for performance
react-doctor/no-global-css-variable-animationerrorPrevents animating global CSS variables
react-doctor/no-large-animated-blurwarnWarns on expensive blur() animations
react-doctor/no-scale-from-zerowarnSuggests better scale animations
react-doctor/no-permanent-will-changewarnDetects permanent will-change declarations
react-doctor/rerender-memo-with-default-valuewarnCatches and [] default props on memoized components
react-doctor/rendering-hydration-no-flickerwarnPrevents mount-time setState causing flicker

Architecture (4 rules)

RuleSeverityDescription
react-doctor/no-generic-handler-nameswarnRequires descriptive event handler names
react-doctor/no-giant-componentwarnFlags components over 300 lines
react-doctor/no-render-in-renderwarnPrevents inline render function calls
react-doctor/no-nested-component-definitionerrorDetects components defined inside other components

Bundle Size (6 rules)

RuleSeverityDescription
react-doctor/no-barrel-importwarnSuggests direct imports over barrel files
react-doctor/no-full-lodash-importwarnRequires importing specific lodash functions
react-doctor/no-momentwarnSuggests date-fns or dayjs instead of moment
react-doctor/prefer-dynamic-importwarnRecommends code splitting for heavy libraries
react-doctor/use-lazy-motionwarnEnforces LazyMotion for framer-motion
react-doctor/no-undeferred-third-partywarnRequires defer/async on third-party scripts

Security (2 rules)

RuleSeverityDescription
react-doctor/no-evalerrorPrevents eval() and dynamic code execution
react-doctor/no-secrets-in-client-codeerrorDetects hardcoded secrets and API keys

Correctness (3 rules)

RuleSeverityDescription
react-doctor/no-array-index-as-keywarnPrevents using array index as key prop
react-doctor/no-prevent-defaultwarnSuggests semantic HTML over preventDefault
react-doctor/rendering-conditional-renderwarnCatches .length in conditional rendering

Accessibility (15 rules)

All jsx-a11y rules from the oxlint plugin for accessible interfaces.

Next.js (16 rules)

Next.js-specific optimization and App Router best practices.

React Native (8 rules)

React Native and Expo platform-specific rules.

Dead Code (4 categories)

Knip integration for detecting unused files, exports, types, and duplicates.

Rule Severity Levels

  • error: Must be fixed, indicates a bug or serious issue
  • warn: Should be reviewed, indicates a performance or maintainability concern

Build docs developers (and LLMs) love