Accessibility rules
embed-alternative-text
Section titled “embed-alternative-text”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.
What to do
Section titled “What to do”Write a text alternative between the tags, such as <object data="chart.svg">Sales grew by 12 percent in 2025.</object>.
Example
Section titled “Example”The element <object data="chart.svg" /> reports missingContent. Use <object data="chart.svg">Sales by month</object>.
no-table-as-layout
Section titled “no-table-as-layout”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.
What to do
Section titled “What to do”Lay the content out with CSS, such as a grid or a flexbox, and keep tables for tabular data.
Example
Section titled “Example”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.
table-header
Section titled “table-header”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.
What to do
Section titled “What to do”Mark the cells of the first row or the first column as <th>.
Example
Section titled “Example”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>.
table-header-reference
Section titled “table-header-reference”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.
What to do
Section titled “What to do”List in headers only the ids of the <th> cells of the row and the column of the cell.
Example
Section titled “Example”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.