{"record":{"id":"db059ef5307f549b","repo":"oxc-project/oxc","slug":"the-attribute-attr-name-is-not-supported-by-th-db059e","errorCode":null,"errorMessage":"The attribute `{attr_name}` is not supported by the role `{role}`. This role is implicit on the element `{el_name}`.","messagePattern":"The attribute `(.+?)` is not supported by the role `(.+?)`\\. This role is implicit on the element `(.+?)`\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/jsx_a11y/role_supports_aria_props.rs","lineNumber":71,"sourceCode":"    /// </ul>\n    /// ```\n    RoleSupportsAriaProps,\n    jsx_a11y,\n    correctness,\n    version = \"0.2.0\",\n    short_description = \"Enforce that elements only contain `aria-*` properties supported by their explicit or implicit role.\",\n);\n\nfn default(span: Span, attr_name: &str, role: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\n        \"The attribute `{attr_name}` is not supported by the role `{role}`.\"\n    ))\n    .with_help(format!(\"Try to remove invalid attribute `{attr_name}`.\"))\n    .with_label(span)\n}\n\nfn is_implicit_diagnostic(span: Span, attr_name: &str, role: &str, el_name: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"The attribute `{attr_name}` is not supported by the role `{role}`. This role is implicit on the element `{el_name}`.\"))\n        .with_help(format!(\"Try to remove invalid attribute `{attr_name}`.\"))\n        .with_label(span)\n}\n\nimpl Rule for RoleSupportsAriaProps {\n    fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) {\n        let AstKind::JSXOpeningElement(jsx_el) = node.kind() else {\n            return;\n        };\n\n        let el_type = get_element_type(ctx, jsx_el);\n\n        let role = has_jsx_prop_ignore_case(jsx_el, \"role\");\n        let role_value = role.map_or_else(\n            || get_implicit_role(jsx_el, &el_type),\n            |i| get_string_literal_prop_value(i),\n        );\n        let is_implicit = role_value.is_some() && role.is_none();","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/jsx_a11y/role_supports_aria_props.rs#L53-L89","documentation":"This is the same `jsx_a11y/role-supports-aria-props` rule, implicit-role variant (constructor `is_implicit_diagnostic` at crates/oxc_linter/src/rules/jsx_a11y/role_supports_aria_props.rs:70). It fires when an `aria-*` attribute is unsupported by the element's implicit role — the role it has from its tag alone, no explicit `role` prop. The message appends the element name so you know the conflict comes from the tag itself.","triggerScenarios":"A JSX opening element (e.g. `<input type=\"text\">`, implicit role `textbox`) carrying an `aria-*` attribute unsupported by that implicit role (e.g. `aria-checked`), with no explicit `role` override present; the element type is resolved via `get_element_type`.","commonSituations":"`aria-checked` left on an `<input>` after switching its type from checkbox to text; `aria-selected` on a `<li>`; aria props forwarded blindly by wrapper components onto native tags; refactors changing input types without cleaning attributes.","solutions":["Remove the `aria-*` attribute that conflicts with the tag's implicit role.","Or set an explicit `role` that legitimately supports the attribute (which switches you to the default variant of this check).","If you changed the element's meaning, sweep it for leftover aria state props."],"exampleFix":"// before\n<input type=\"text\" aria-checked=\"true\" value={v} onChange={c} />\n\n// after\n<input type=\"text\" value={v} onChange={c} />","handlingStrategy":"validation","validationCode":"npx oxlint --jsx-a11y/role-supports-aria-props src/","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After changing an input type or tag, sweep the element for stale aria attributes.","Do not blanket-forward aria props through wrapper components onto native tags.","Run the linter locally before pushing refactors that touch input types."],"tags":["jsx-a11y","react","accessibility","aria","aria-roles","lint"],"backgroundTag":"unsupported-aria-attribute-for-role","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"}