From 4495c4ce11c54fbbb17234d7029e06285ee85692 Mon Sep 17 00:00:00 2001 From: LB Date: Wed, 23 Oct 2024 14:25:44 +1000 Subject: [PATCH] [patch] `no-redundandant-roles`: allow `` Setting role="img" is a valid use case to work around a Safari bug for better accessibility when the source image is an SVG file. This improvement does not account for variables in the `src` attribute but adds a valid exception for when we can parse the string. Fixes #936 --- __tests__/src/rules/no-redundant-roles-test.js | 4 ++++ docs/rules/no-redundant-roles.md | 1 + src/util/implicitRoles/img.js | 10 ++++++++++ 3 files changed, 15 insertions(+) diff --git a/__tests__/src/rules/no-redundant-roles-test.js b/__tests__/src/rules/no-redundant-roles-test.js index 60cc2185e..068e54049 100644 --- a/__tests__/src/rules/no-redundant-roles-test.js +++ b/__tests__/src/rules/no-redundant-roles-test.js @@ -83,12 +83,16 @@ ruleTester.run(`${ruleName}:recommended (valid list role override)`, rule, { { code: '