React Doctor
492 rules react-doctor@0.9.18
Complete effective rule inventory.
Rules
No enabled React Doctor rules match this search.
-
react-doctor/active-static-assetPrefer
<img>for SVG images; if SVG must be served directly, use attachment disposition and a CSP that blocks scripts and objects.: warning in React projects -
react-doctor/alt-textGive every meaningful image an
alt,aria-label, oraria-labelledby.: error in React projects -
react-doctor/anchor-ambiguous-textName where a link goes. Avoid 'click here', 'learn more', and 'link'.
: warning in React projects -
react-doctor/anchor-has-contentPut readable text inside every link.
: warning in React projects -
react-doctor/anchor-is-validGive links a real destination. Use
<button>for in-page actions.: warning in React projects -
react-doctor/anchor-target-existsAdd an element with the referenced id, or update the fragment link to point to an existing target.
: warning in React projects -
react-doctor/aria-activedescendant-has-tabindexAdd
tabIndexso keyboard users can reach elements that usearia-activedescendant.: warning in React projects -
react-doctor/aria-propsOnly use
aria-*attributes that actually exist.: error in React projects -
react-doctor/aria-proptypesGive each
aria-*attribute the kind of value it expects.: error in React projects -
react-doctor/aria-roleUse a real, non-abstract ARIA role so assistive tech can expose the element correctly.
: error in React projects -
react-doctor/aria-unsupported-elementsDo not put
roleoraria-*on reserved HTML elements.: error in React projects -
react-doctor/artifact-env-leakTreat public env prefixes as publication, not secrecy; keep secret env vars server-only and rebuild after rotating leaked keys.
: error in React projects -
react-doctor/artifact-secret-leakRemove the secret from client bundles/static assets, rotate it, and route privileged service calls through server-only code.
: error in React projects -
react-doctor/auth-token-in-web-storageDon't persist auth tokens (JWTs, access/refresh tokens, secrets) in
localStorage/sessionStorage; they're readable by any XSS. Use anHttpOnlycookie set by the server.: warning in React projects -
react-doctor/autocomplete-validUse a valid autofill token in
autoCompleteso browsers can fill the right field reliably.: warning in React projects -
react-doctor/base-ui-dialog-popup-requires-titleGive every Base UI Dialog.Popup and AlertDialog.Popup a Title part (visually hidden when the design shows no heading) or name the dialog with aria-label.
: warning in React projects -
react-doctor/base-ui-field-requires-labelGive every Field.Root that wraps a Field.Control a Field.Label (visually hidden when the design shows no label) or name the control directly with aria-label.
: warning in React projects -
react-doctor/base-ui-tabs-tab-requires-listRender each Base UI Tabs.Tab inside Tabs.List so the tablist role and arrow-key focus handling cover every tab.
: warning in React projects -
react-doctor/build-pipeline-secret-boundaryRun dependency installs with scripts disabled before exposing secrets, isolate untrusted build code, and move signing/deploy authority into a narrow privileged step.
: warning in React projects -
react-doctor/button-has-typeSet an explicit button
typeso plain buttons do not submit forms by accident:type="button","submit", or"reset".: warning in React projects -
react-doctor/checked-requires-onchange-or-readonlyAdd
onChange,readOnly, ordefaultCheckedso React knows whether the checkbox is editable, display-only, or uncontrolled.: warning in React projects -
react-doctor/class-component-missing-component-will-unmount-teardownRelease listeners and timers acquired in
componentDidMount/constructorby adding acomponentWillUnmountthat removes them (or use MobXdisposeOnUnmount).: warning in React projects -
react-doctor/click-events-have-key-eventsPair
onClickwith a key handler so keyboard users can trigger it.: warning in React projects -
react-doctor/clickjacking-redirect-riskAllowlist redirect origins/paths, set
frame-ancestorsfor privileged pages, and avoid URL-prefilled privileged dialogs.: warning in React projects -
react-doctor/command-execution-input-riskAvoid shell execution for caller-controlled values. Use fixed commands, argument arrays, strict allowlists, and no shell interpolation.
: error in React projects -
react-doctor/control-has-associated-labelGive every interactive control a label screen readers can read.
: warning in React projects -
react-doctor/cors-cookie-trust-riskKeep auth cookies host-only and HttpOnly, avoid credentialed CORS for less-trusted docs/vendor origins, and isolate documentation domains from app sessions.
: warning in React projects -
react-doctor/dangerous-html-sinkPrefer rendering structured React nodes. If HTML is required, sanitize with a well-reviewed sanitizer and keep the trust boundary close to the sink.
: warning in React projects -
react-doctor/debounce-no-cleanupA debounced/throttled callback holds a pending timer that still fires after unmount, so add
useEffect(() => () => debounced.cancel(), [debounced])to cancel the trailing invocation when the component tears down.: warning in React projects -
react-doctor/dialog-has-accessible-nameGive every
<dialog>/role="dialog"an accessible name witharia-labeloraria-labelledby(referencing the dialog's title element).: warning in React projects -
react-doctor/duplicate-jsx-subtreeExtract a shared component when the repeated JSX trees represent the same UI concept and should evolve together.
: warning in React projects -
react-doctor/effect-listener-cleanup-mismatchPass the same callback binding and capture flag to
addEventListenerandremoveEventListener, or abort the registration's local AbortController during cleanup.: error in React projects