Skip to content

Accessibility rules

Finds JSX <object> elements without visible content between their tags: text, an element that is not hidden, or an expression.

On in the recommended and all configs.

Screen readers and browsers that cannot show the embedded object fall back to the content of the element.

Write a text alternative between the tags, such as <object data="chart.svg">Sales grew by 12 percent in 2025.</object>.

The element <object data="chart.svg" /> reports missingContent. Use <object data="chart.svg">Sales by month</object>.

Finds JSX <table> elements with role="presentation" or role="none".

On in the recommended and all configs.

A table used for layout confuses screen readers and breaks on small screens, and the role only hides the confusion.

Lay the content out with CSS, such as a grid or a flexbox, and keep tables for tabular data.

The element <table role="presentation"><tr><td>{menu}</td><td>{page}</td></tr></table> reports layoutTable. Use <div className="layout">{menu}{page}</div> with a CSS grid.

Finds a JSX <table> without a full row or a full column of <th> cells, unless it is a layout table or hidden with aria-hidden.

On in the recommended and all configs.

Screen readers use header cells to tell users which row and column a data cell belongs to.

Mark the cells of the first row or the first column as <th>.

The element <table><tr><td>Name</td><td>Age</td></tr><tr><td>Ada</td><td>36</td></tr></table> reports missingHeader. Write the first row as <tr><th>Name</th><th>Age</th></tr>.

Finds headers attributes of JSX table cells that name an id that is not the id of a <th> in the same row or column of the cell.

On in the recommended and all configs.

Screen readers read the headers that the headers attribute names, so a wrong id announces the wrong header or none.

List in headers only the ids of the <th> cells of the row and the column of the cell.

In a table whose header row has <th id="name"> and <th id="age">, the cell <td headers="email"> reports unknownHeader. Use headers="age" for the age column.