Skip to content

jsx_a11y/autocomplete-valid Correctness

This rule is turned on by default.

What it does

Enforces that an element's autocomplete attribute must be a valid value.

Why is this bad?

Incorrectly using the autocomplete attribute may decrease the accessibility of the website for users.

Example

Examples of incorrect code for this rule:

jsx
<input autocomplete="invalid-value" />

Examples of correct code for this rule:

jsx
<input autocomplete="name" />

How to use

To enable this rule in the CLI or using the config file, you can use:

bash
oxlint --deny jsx-a11y/autocomplete-valid --jsx-a11y-plugin
json
{
  "plugins": ["jsx-a11y"],
  "rules": {
    "jsx-a11y/autocomplete-valid": "error"
  }
}

References

Released under the MIT License.