✅ The extends: 'recommended'
property in a configuration file enables this rule.
MDN explains the motivation of this rule nicely:
Avoid using tabindex values greater than 0. Doing so makes it difficult for people who rely on assistive technology to navigate and operate page content. Instead, write the document with the elements in a logical sequence.
This rule prevents usage of any tabindex
values other than 0
and -1
. It does allow for dynamic values (choosing which value to show based on some condition / helper / etc), but only if that inline if
condition has static 0
/-1
as the value.
This rule takes no arguments.
This rule allows the following:
This rule forbids the following: