{"record":{"id":"740963a1c2291e41","repo":"oxc-project/oxc","slug":"this-element-does-not-support-aria-roles-states","errorCode":null,"errorMessage":"This element does not support ARIA roles, states, or properties.","messagePattern":"This element does not support ARIA roles, states, or properties\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs","lineNumber":50,"sourceCode":"    /// ```\n    ///\n    /// Examples of **correct** code for this rule:\n    /// ```jsx\n    /// <meta charset=\"UTF-8\" />\n    /// ```\n    AriaUnsupportedElements,\n    jsx_a11y,\n    correctness,\n    fix,\n    version = \"0.1.1\",\n    short_description = \"Enforces that reserved DOM elements do not contain ARIA roles, states, or properties.\",\n);\n\n#[derive(Debug, Default, Clone)]\npub struct AriaUnsupportedElements;\n\nfn aria_unsupported_elements_diagnostic(span: Span, attr_name: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"This element does not support ARIA roles, states, or properties.\")\n        .with_help(format!(\"Try removing the prop `{attr_name}`.\"))\n        .with_label(span)\n}\n\nimpl Rule for AriaUnsupportedElements {\n    fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) {\n        if let AstKind::JSXOpeningElement(jsx_el) = node.kind() {\n            let el_type = get_element_type(ctx, jsx_el);\n            if RESERVED_HTML_TAG.contains(&el_type.as_ref()) {\n                for attr in &jsx_el.attributes {\n                    let attr = match attr {\n                        JSXAttributeItem::Attribute(attr) => attr,\n                        JSXAttributeItem::SpreadAttribute(_) => continue,\n                    };\n                    let attr_name = get_jsx_attribute_name(&attr.name);\n                    let attr_name = attr_name.cow_to_ascii_lowercase();\n                    if attr_name == \"role\" || is_valid_aria_property(&attr_name) {\n                        ctx.diagnostic_with_fix(","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs#L32-L68","documentation":"Fires from jsx-a11y/aria-unsupported-elements when a reserved/DOM element that cannot be exposed to accessibility tree (per the rule's element list, such as meta, html, script) is given a role or aria-* attribute. The helper interpolates the offending attribute name in the help text.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the `role`/`aria-*` attribute from the reserved element","Move the ARIA attributes to an element that supports them"],"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"}