diff --git a/crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalid.jsx.snap b/crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalid.jsx.snap index ac45ba088751..f32ed0e2fe82 100644 --- a/crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalid.jsx.snap +++ b/crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalid.jsx.snap @@ -1,7 +1,6 @@ --- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.jsx -snapshot_kind: text --- # Input ```jsx diff --git a/crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx b/crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx new file mode 100644 index 000000000000..4ba9807705d6 --- /dev/null +++ b/crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx @@ -0,0 +1,19 @@ +// https://github.com/web-platform-tests/wpt/blob/master/html-aam/roles-generic.html +<> + x + x + x + + x + +
x+
x+ x + x + x + x +>; diff --git a/crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx.snap b/crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx.snap new file mode 100644 index 000000000000..408b5dda9c43 --- /dev/null +++ b/crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx.snap @@ -0,0 +1,256 @@ +--- +source: crates/biome_js_analyze/tests/spec_tests.rs +expression: invalidHtmlAamRoleGeneric.jsx +--- +# Input +```jsx +// https://github.com/web-platform-tests/wpt/blob/master/html-aam/roles-generic.html +<> + x + x + x + + x + +
x+
x+ x + x + x + x +>; + +``` + +# Diagnostics +``` +invalidHtmlAamRoleGeneric.jsx:3:10 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'b' element is redundant, because it is implied by its semantic. + + 1 │ // https://github.com/web-platform-tests/wpt/blob/master/html-aam/roles-generic.html + 2 │ <> + > 3 │ x + │ ^^^^^^^^^ + 4 │ x + 5 │ x + + i Unsafe fix: Remove the role attribute. + + 3 │ → x + │ -------------- + +``` + +``` +invalidHtmlAamRoleGeneric.jsx:4:12 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'bdi' element is redundant, because it is implied by its semantic. + + 2 │ <> + 3 │ x + > 4 │ x + │ ^^^^^^^^^ + 5 │ x + 6 │ + + i Unsafe fix: Remove the role attribute. + + 4 │ → x + │ -------------- + +``` + +``` +invalidHtmlAamRoleGeneric.jsx:5:12 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'bdo' element is redundant, because it is implied by its semantic. + + 3 │ x + 4 │ x + > 5 │ x + │ ^^^^^^^^^ + 6 │ + 7 │ x + + i Unsafe fix: Remove the role attribute. + + 5 │ → x + │ -------------- + +``` + +``` +invalidHtmlAamRoleGeneric.jsx:6:23 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'data' element is redundant, because it is implied by its semantic. + + 4 │ x + 5 │ x + > 6 │ + │ ^^^^^^^^^ + 7 │ x + 8 │ + + i Unsafe fix: Remove the role attribute. + + 6 │ → + │ -------------- + +``` + +``` +invalidHtmlAamRoleGeneric.jsx:9:17 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'div' element is redundant, because it is implied by its semantic. + + 7 │ x + 8 │ + > 9 │
x+ 14 │
x+ + i Unsafe fix: Remove the role attribute. + + 12 │ → x + │ -------------- + +``` + +``` +invalidHtmlAamRoleGeneric.jsx:13:12 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'pre' element is redundant, because it is implied by its semantic. + + 11 │ + 12 │ x + > 13 │
x+ │ ^^^^^^^^^ + 14 │
x+ 15 │ x + + i Unsafe fix: Remove the role attribute. + + 13 │ →
x+ │ -------------- + +``` + +``` +invalidHtmlAamRoleGeneric.jsx:14:10 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'q' element is redundant, because it is implied by its semantic. + + 12 │ x + 13 │
x+ > 14 │
x+ │ ^^^^^^^^^ + 15 │ x + 16 │ x + + i Unsafe fix: Remove the role attribute. + + 14 │ →
x+ │ -------------- + +``` + +``` +invalidHtmlAamRoleGeneric.jsx:15:13 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'samp' element is redundant, because it is implied by its semantic. + + 13 │
x+ 14 │
x+ > 15 │ x + │ ^^^^^^^^^ + 16 │ x + 17 │ x + + i Unsafe fix: Remove the role attribute. + + 15 │ → x + │ -------------- + +``` + +``` +invalidHtmlAamRoleGeneric.jsx:16:14 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'small' element is redundant, because it is implied by its semantic. + + 14 │
x+ 15 │ x + > 16 │ x + │ ^^^^^^^^^ + 17 │ x + 18 │ x + + i Unsafe fix: Remove the role attribute. + + 16 │ → x + │ -------------- + +``` + +``` +invalidHtmlAamRoleGeneric.jsx:17:13 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'span' element is redundant, because it is implied by its semantic. + + 15 │ x + 16 │ x + > 17 │ x + │ ^^^^^^^^^ + 18 │ x + 19 │ >; + + i Unsafe fix: Remove the role attribute. + + 17 │ → x + │ -------------- + +``` + +``` +invalidHtmlAamRoleGeneric.jsx:18:10 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Using the role attribute 'generic' on the 'u' element is redundant, because it is implied by its semantic. + + 16 │ x + 17 │ x + > 18 │ x + │ ^^^^^^^^^ + 19 │ >; + 20 │ + + i Unsafe fix: Remove the role attribute. + + 18 │ → x + │ -------------- + +```