Rules
no-inline-prop-on-memo-component
no-inline-prop-on-memo-component
Severity: warn
Rule ID:Good:
Rule ID:
react-doctor/no-inline-prop-on-memo-componentDetects inline functions, objects, arrays, or JSX passed as props to components wrapped in React.memo(). These create new references every render, breaking memoization.Bad:no-usememo-simple-expression
no-usememo-simple-expression
Severity: warn
Rule ID:Good:
Rule ID:
react-doctor/no-usememo-simple-expressionFlags useMemo wrapping trivially cheap expressions. The overhead of useMemo (function call, dependency comparison) exceeds the computation cost.Bad:no-layout-property-animation
no-layout-property-animation
Severity: error
Rule ID:Good:Layout properties detected: width, height, top, left, right, bottom, padding, margin, border, fontSize, lineHeight, gap.
Rule ID:
react-doctor/no-layout-property-animationPrevents animating CSS properties that trigger layout recalculation: width, height, top, left, padding, margin, etc. These cause expensive reflows on every frame.Bad:no-transition-all
no-transition-all
Severity: warn
Rule ID:Good:
Rule ID:
react-doctor/no-transition-allFlags transition: "all" which animates every property including expensive layout properties.Bad:no-global-css-variable-animation
no-global-css-variable-animation
Severity: error
Rule ID:Good:
Rule ID:
react-doctor/no-global-css-variable-animationPrevents updating CSS variables in requestAnimationFrame or setInterval. This forces style recalculation on all inheriting elements every frame.Bad:no-large-animated-blur
no-large-animated-blur
Severity: warn
Rule ID:Good:
Rule ID:
react-doctor/no-large-animated-blurWarns on blur() filters over 10px. Blur is GPU-intensive and cost escalates with radius and layer size. Can exceed GPU memory on mobile.Bad:no-scale-from-zero
no-scale-from-zero
Severity: warn
Rule ID:Good:
Rule ID:
react-doctor/no-scale-from-zeroSuggests using scale: 0.95 with opacity: 0 instead of scale: 0 for more natural entrance animations.Bad:no-permanent-will-change
no-permanent-will-change
Severity: warn
Rule ID:Good:
Rule ID:
react-doctor/no-permanent-will-changeDetects permanent will-change declarations. will-change wastes GPU memory and should only be applied during active animations.Bad:rerender-memo-with-default-value
rerender-memo-with-default-value
Severity: warn
Rule ID:Good:
Rule ID:
react-doctor/rerender-memo-with-default-valueCatches default prop values {} or [] in destructured props. These create new references every render.Bad:rendering-hydration-no-flicker
rendering-hydration-no-flicker
Severity: warn
Rule ID:Good:
Rule ID:
react-doctor/rendering-hydration-no-flickerPrevents useEffect(() => setState(...), []) pattern that causes a flash during hydration. The effect runs after the initial render, causing a second render.Bad:JavaScript Performance Rules
React Doctor also includes general JavaScript performance rules:react-doctor/async-parallel- Use Promise.all() for independent async operationsreact-doctor/js-combine-iterations- Combine chained map/filter callsreact-doctor/js-tosorted-immutable- Use toSorted() instead of […arr].sort()react-doctor/js-hoist-regexp- Hoist RegExp out of loopsreact-doctor/js-set-map-lookups- Use Set/Map for O(1) lookups in loops
Related Rules
- State and Effects Rules - State management rules
- Architecture Rules - Component structure rules