oxc-project/oxc · error
`{autocomplete}` is not a valid value for `autocomplete`.
Error message
`{autocomplete}` is not a valid value for `autocomplete`. What it means
Fires from jsx-a11y/autocomplete-valid when an input's autocomplete attribute value is not one of the HTML autocomplete tokens defined by the spec (on/off, name, email, new-password, cc-* etc.). The helper interpolates the invalid token and advises changing it to a valid value.
Source
Thrown at crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs:23
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::Span;
use oxc_str::CompactStr;
use rustc_hash::FxHashSet;
use schemars::JsonSchema;
use serde::Deserialize;
use serde_json::Value;
use std::ops::Deref;
use crate::{
AstNode,
context::LintContext,
rule::{DefaultRuleConfig, Rule},
utils::{get_element_type, has_jsx_prop_ignore_case},
};
fn autocomplete_valid_diagnostic(span: Span, autocomplete: &str) -> OxcDiagnostic {
OxcDiagnostic::warn(format!("`{autocomplete}` is not a valid value for `autocomplete`."))
.with_help(format!("Change `{autocomplete}` to a valid value for `autocomplete`."))
.with_label(span)
}
#[derive(Debug, Default, Clone, Deserialize)]
pub struct AutocompleteValid(Box<AutocompleteValidConfig>);
#[derive(Debug, Clone, PartialEq, Eq, JsonSchema, Deserialize)]
#[serde(rename_all = "camelCase", default, deny_unknown_fields)]
pub struct AutocompleteValidConfig {
/// List of custom component names that should be treated as input elements.
input_components: FxHashSet<CompactStr>,
}
impl Deref for AutocompleteValid {
type Target = AutocompleteValidConfig;
fn deref(&self) -> &Self::Target {View on GitHub (pinned to e1e7af627c)
Solutions
- Change the value to a valid HTML autocomplete token (e.g. 'name', 'email', 'new-password')
- Remove the `autocomplete` attribute if autofill hints do not apply
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs:23 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of oxc-project/oxc@e1e7af627c (2026-08-20).
Data as JSON: /api/errors/f0a42513c965602b.
Report an issue: GitHub.