{"record":{"id":"f0a42513c965602b","repo":"oxc-project/oxc","slug":"autocomplete-is-not-a-valid-value-for-autocom","errorCode":null,"errorMessage":"`{autocomplete}` is not a valid value for `autocomplete`.","messagePattern":"`(.+?)` is not a valid value for `autocomplete`\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs","lineNumber":23,"sourceCode":"use oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::Span;\nuse oxc_str::CompactStr;\nuse rustc_hash::FxHashSet;\nuse schemars::JsonSchema;\nuse serde::Deserialize;\nuse serde_json::Value;\nuse std::ops::Deref;\n\nuse crate::{\n    AstNode,\n    context::LintContext,\n    rule::{DefaultRuleConfig, Rule},\n    utils::{get_element_type, has_jsx_prop_ignore_case},\n};\n\nfn autocomplete_valid_diagnostic(span: Span, autocomplete: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"`{autocomplete}` is not a valid value for `autocomplete`.\"))\n        .with_help(format!(\"Change `{autocomplete}` to a valid value for `autocomplete`.\"))\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone, Deserialize)]\npub struct AutocompleteValid(Box<AutocompleteValidConfig>);\n\n#[derive(Debug, Clone, PartialEq, Eq, JsonSchema, Deserialize)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\npub struct AutocompleteValidConfig {\n    /// List of custom component names that should be treated as input elements.\n    input_components: FxHashSet<CompactStr>,\n}\n\nimpl Deref for AutocompleteValid {\n    type Target = AutocompleteValidConfig;\n\n    fn deref(&self) -> &Self::Target {","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs#L5-L41","documentation":"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.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}