Ensures that the tabindex
attribute is not positive
-
Type: suggestion
-
💡 Provides suggestions on how to fix issues (https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
The rule does not have any configuration options.
The following examples are generated automatically from the actual unit tests within the plugin, so you can be assured that their behavior is accurate based on the current commit.
❌ - Toggle examples of incorrect code for this rule
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<div tabindex="5"></div>
~
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<div [attr.tabindex]="21"></div>
~~
✅ - Toggle examples of correct code for this rule
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<span></span>
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<span id="2"></span>
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<span tabindex></span>
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<span tabindex="-1"></span>
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<span tabindex="0"></span>
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<span [attr.tabindex]="-1"></span>
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<span [attr.tabindex]="0"></span>
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<span [attr.tabindex]="tabIndex"></span>
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<span [attr.tabindex]="null"></span>
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<span [attr.tabindex]="undefined"></span>
{
"rules": {
"@angular-eslint/template/no-positive-tabindex": [
"error"
]
}
}
<app-test [tabindex]="1"></app-test>