diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs index 267ece6742bdd9..5e7f846e7430ce 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs @@ -30,7 +30,8 @@ declare_oxc_lint! { /// ``` /// AriaUnsupportedElements, - correctness + correctness, + fix } #[derive(Debug, Default, Clone)] @@ -56,7 +57,10 @@ impl Rule for AriaUnsupportedElements { }; let attr_name = get_jsx_attribute_name(&attr.name).to_lowercase(); if INVALID_ATTRIBUTES.contains(&attr_name) { - ctx.diagnostic(aria_unsupported_elements_diagnostic(attr.span, &attr_name)); + ctx.diagnostic_with_fix( + aria_unsupported_elements_diagnostic(attr.span, &attr_name), + |fixer| fixer.delete(&attr.span), + ); } } } @@ -416,7 +420,16 @@ fn test() { (r#""#, None), ]; + let fix = vec![ + (r"