React Doctor
492 rules react-doctor@0.9.18
Complete effective rule inventory.
Rules
No enabled React Doctor rules match this search.
-
react-doctor/local-rpc-native-bridge-riskUse exact origin allowlists after URL parsing, per-request nonces, narrow methods, and never expose install/update commands to arbitrary web pages.
: warning in React projects -
react-doctor/mdx-ssr-execution-riskUse a constrained compiler for untrusted content, disable expressions/raw HTML, sandbox renderers, and avoid caching attacker-controlled output across tenants.
: warning in React projects -
react-doctor/media-has-captionAdd
<track kind="captions">inside every<audio>/<video>.: warning in React projects -
react-doctor/mobx-no-make-auto-observable-in-inheritanceReplace inheritance with composition, or annotate inherited members explicitly with
makeObservable.: error in React projects -
react-doctor/mobx-no-observer-wrapped-memoPass the component directly to
observer, or apply Reactmemooutside the resulting observer component.: error in React projects -
react-doctor/mobx-reaction-disposer-discardedKeep the disposer returned by
reactionorautorunand invoke it during teardown.: warning in React projects -
react-doctor/motion-animate-presence-must-outlive-childKeep AnimatePresence mounted and place the condition around its child so Motion can observe and animate the child leaving.
: warning in React projects -
react-doctor/motion-animate-presence-requires-keyGive every direct AnimatePresence child a stable key derived from its identity so Motion can track which element exits.
: warning in React projects -
react-doctor/motion-animate-presence-wait-single-childRender one direct child at a time in
mode="wait", or usesyncorpopLayoutwhen several children can be present.: warning in React projects -
react-doctor/motion-create-in-renderCreate Motion components at module scope, or memoize a genuinely dynamic component factory so its identity remains stable.
: warning in React projects -
react-doctor/motion-drag-axis-constraint-mismatchConstrain horizontal drags with left or right bounds and vertical drags with top or bottom bounds, keeping paired bounds in ascending order.
: warning in React projects -
react-doctor/motion-imperative-animation-in-renderStart imperative animations from an effect or user interaction, and derive render output declaratively from props and state.
: error in React projects -
react-doctor/motion-keyframe-times-mismatchProvide one transition time for each keyframe so Motion can place every value on the animation timeline.
: error in React projects -
react-doctor/motion-layout-on-inline-elementUse inline-block, block, flex, or grid so the browser can apply Motion's transform-based layout animation.
: warning in React projects -
react-doctor/motion-unstable-layout-id-in-iterationDerive repeated layout IDs from stable item identity, or scope each repeated component with a LayoutGroup ID derived from the item.
: warning in React projects -
react-doctor/motion-use-transform-range-lengthGive useTransform input and output ranges the same number of entries so every input stop has an output value.
: error in React projects -
react-doctor/motion-value-constructor-in-renderUse useMotionValue inside React components, or create a manual motionValue outside the render path.
: warning in React projects -
react-doctor/motion-value-subscription-in-renderSubscribe with useMotionValueEvent, or create the subscription in an effect and return its cleanup function.
: error in React projects -
react-doctor/mouse-events-have-key-eventsPair mouse events with keyboard ones so keyboard users are not left out.
: warning in React projects -
react-doctor/nextjs-metadata-url-consistencyUse the same preferred page URL for alternates.canonical and openGraph.url so search and social previews identify one page.
: warning in Next.js projects -
react-doctor/no-access-keyDo not use
accessKey. It conflicts with assistive tech shortcuts.: warning in React projects -
react-doctor/no-aria-hidden-on-focusableRemove
aria-hiddenfrom focusable elements, or stop them being focusable, so keyboard users do not land on content screen readers hide.: warning in React projects -
react-doctor/no-arithmetic-on-optional-chained-operandAn optional chain is
undefinedwhen it short-circuits, so*///%on it producesNaN, which silently corrupts formatting and comparisons. Provide a?? fallbackor guard the chain root before the arithmetic.: warning in React projects -
react-doctor/no-array-index-as-keyUse a stable id from the item, like
key={item.id}orkey={item.slug}. Index keys break when the list reorders or filters.: error in React projects -
react-doctor/no-assertive-statusKeep
role="status"polite. Userole="alert"only when an interruption is genuinely imperative.: warning in React projects -
react-doctor/no-async-effect-callbackDon't make the effect callback
async. Define an async function inside the effect and call it, then return a real cleanup function if you need one.: warning in React projects -
react-doctor/no-async-event-handler-without-reentry-guardAn async onClick/onSubmit handler on a host control that awaits a mutating request and sets state only afterward stays interactive across the await, so a double-click fires the write twice. Add a leading
if (busy) returnguard, or set a flag before the await insidetryand reset it infinallywhile the control is disabled.: warning in React projects -
react-doctor/no-autofocusDo not use
autoFocus. It disorients users on load.: warning in React projects -
react-doctor/no-autoplay-without-mutedAlways pair
autoPlaywithmuted(andplaysInline):<video autoPlay muted loop playsInline />. If the sound matters, dropautoPlayand let users start it.: warning in React projects -
react-doctor/no-blocked-pasteAllow paste so people can use password managers, verification codes, assistive tools, and copied text without retyping it.
: error in React projects -
react-doctor/no-collapsed-literal-or-chain-as-valueCompare against each value separately (or use an array
.includes(x)) instead of an all-literal||/&&chain, which short-circuits to its first literal and drops the rest.: warning in React projects -
react-doctor/no-conflicting-spring-optionsChoose either stiffness/damping/mass or duration/bounce for a Motion spring so every configured value takes effect.
: warning in React projects