react-doctor/design-no-redundant-padding-axes
Collapse `px-N py-N` to `p-N` when both axes match. Keep them split only when one axis varies at a breakpoint (`py-2 md:py-3`)
- Category: Architecture
- Severity: warn
- Source:
oxlint-plugin-react-doctor - Framework: global
- Enabled when: always
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Fires when className contains matching px-N and py-N tokens with identical numeric or arbitrary values (px-4 py-4, or px-[10px] py-[10px], negatives included). Skipped if either axis appears with a responsive variant like md:px-6 — per-breakpoint variation is a legit reason to keep them split. Only static className strings are inspected.
Fix prompt
Use this once validation confirms the diagnostic is real.
Collapse to p-N (px-4 py-4 → p-4, px-[10px] py-[10px] → p-[10px]). Keep them split only when one axis varies at a breakpoint (py-2 md:py-3) or you need a negative on just one side. https://tailwindcss.com/docs/padding
Related rules
More Architecture rules from the rules reference:
react-doctor/design-no-redundant-size-axes: Collapse `w-N h-N` to `size-N` (Tailwind v3.4+) when both axes matchreact-doctor/design-no-space-on-flex-children: Use `gap-*` on the flex/grid parent. `space-x-*` / `space-y-*` produce phantom gaps when a sibling is conditionally rendered, lose vertical spacing on wrapped lines, and don't mirror in RTLreact-doctor/design-no-three-period-ellipsis: Use the typographic ellipsis "…" (or `…`) instead of three periods — pairs with action-with-followup labels ("Rename…", "Loading…")react-doctor/display-name: Give each component a stable displayName so React DevTools shows a real name instead of "Unknown".react-doctor/forbid-component-props: Configure forbidden props per component via the `forbidComponentProps.forbid` setting.