Skip to content

scopeProps

Reports scope props on non-th elements.

✅ This rule is included in the jsx logical and logicalStrict presets.

The scope attribute defines whether a table header is a column header or row header. Using it on non-<th> elements has no semantic meaning and may confuse assistive technologies.

This is required for WCAG 1.3.1 and 4.1.1 compliance.

<
JSX.IntrinsicElements.div: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>
div
scope />
Error ts(2322) ― Type '{ scope: true; }' is not assignable to type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'. Property 'scope' does not exist on type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'.
<
JSX.IntrinsicElements.div: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>
div
scope="col" />
Error ts(2322) ― Type '{ scope: string; }' is not assignable to type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'. Property 'scope' does not exist on type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'.
<
JSX.IntrinsicElements.td: DetailedHTMLProps<TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>
td
TdHTMLAttributes<HTMLTableDataCellElement>.scope?: string | undefined
scope
="row" />

If you’re not working with HTML tables, you can disable this rule.

Made with ❤️‍🔥 around the world by the Flint team and contributors.