jsx-a11y/scope
Disallow the scope attribute on elements other than th — it is only defined for table header cells.
- Category: Accessibility
- Severity: warn
- Source:
oxlint-builtin:jsx-a11y - Framework: global
- Enabled when: always (unless customRulesOnly=true)
- Documentation: https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/scope
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Fires when the scope attribute appears on any element other than <th> — scope is only defined in HTML for table header cells. False positives are essentially impossible: scope has no meaning on <div>, <td>, or any non-th element, so any non-<th> usage is either a copy-paste error or a misunderstanding of the attribute.
Fix prompt
Use this once validation confirms the diagnostic is real.
Remove scope from the non-<th> element. If the element should associate headers with data cells, restructure the markup to use a real <th scope='col'> or <th scope='row'> inside a <table>. For complex tables where scope is insufficient, use the headers attribute on <td> pointing to one or more <th id> values. See https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/scope
Related rules
More Accessibility rules from the rules reference:
react-doctor/alt-text: Require alternative text on img, area, input[type='image'], and object elements so screen readers can describe them.react-doctor/anchor-ambiguous-text: Describe a link's destination — avoid bare 'click here' / 'learn more' / 'link' as the only link text.react-doctor/anchor-has-content: Add visible or aria-labelled text inside every `<a>`.react-doctor/anchor-is-valid: Require anchors to navigate to a real destination — use a button for click-only actions instead of href='#' or javascript:void(0).react-doctor/aria-activedescendant-has-tabindex: Add `tabIndex` to elements with `aria-activedescendant` so they're keyboard-focusable.