src/content/docs/linter/rules/use-valid-autocomplete.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JavaScript (and super languages)" icon="seti:javascript"> ## Summary - Rule available since: `v1.9.0` - Diagnostic Category: [`lint/a11y/useValidAutocomplete`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule doesn't have a fix. - The default severity of this rule is [**error**](/reference/diagnostics#error). - Sources: - Same as [`jsx-a11y/autocomplete-valid`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/autocomplete-valid.md){
"linter": {
"rules": {
"a11y": {
"useValidAutocomplete": "error"
}
}
}
}
Use valid values for the autocomplete attribute on input elements.
The HTML autocomplete attribute only accepts specific predefined values.
This allows for more detailed purpose definitions compared to the type attribute.
Using these predefined values, user agents and assistive technologies can present input purposes to users in different ways.
<input type="text" autocomplete="incorrect" />
<>
<input type="text" autocomplete="name" />
<MyInput autocomplete="incorrect" />
</>
{
"linter": {
"rules": {
"a11y": {
"useValidAutocomplete": {
"options": {
"inputComponents": [
"MyInput"
]
}
}
}
}
}
}