Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(js_analyzer): add graphics-symbol role #2294

Merged
merged 2 commits into from
Apr 6, 2024
Merged

Conversation

drwpow
Copy link
Contributor

@drwpow drwpow commented Apr 4, 2024

Summary

Adds the graphics-symbol ARIA role which should be replaceable with img for valid SVG ARIA roles (and is more descriptive for icons). Updates possible usage from current recommendations from an article from University at Melbourne.

jsx-a11y had this same problem at one point, but I think that’s been fixed already and that currently supports these roles for SVGs, so this should just bring parity with that (or at least, that’s the intention)

Also adds graphics-document and graphics-object roles for completeness…but I might have messed something up? Open to feedback if something’s in the wrong place 🙂

Test Plan

  • Tests updated

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Apr 4, 2024
Copy link

netlify bot commented Apr 4, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit e006ecd
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/660fcd58ae3ed3000867ca4c
😎 Deploy Preview https://deploy-preview-2294--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@drwpow drwpow changed the title Add graphics-document, graphics-object, graphics-symbol roles fix(js_analyzer) Add graphics-document, graphics-object, graphics-symbol roles Apr 4, 2024
@drwpow drwpow changed the title fix(js_analyzer) Add graphics-document, graphics-object, graphics-symbol roles fix(js_analyzer) Add graphics-symbol role Apr 4, 2024
Copy link

codspeed-hq bot commented Apr 4, 2024

CodSpeed Performance Report

Merging #2294 will not alter performance

Comparing drwpow:main (e006ecd) with main (3adb1d9)

Summary

✅ 93 untouched benchmarks

@github-actions github-actions bot added the A-Website Area: website label Apr 5, 2024
Copy link
Member

@unvalley unvalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you!

@unvalley unvalley changed the title fix(js_analyzer) Add graphics-symbol role fix(js_analyzer): add graphics-symbol role Apr 6, 2024
@unvalley unvalley merged commit 9689ed1 into biomejs:main Apr 6, 2024
17 checks passed
@Sec-ant
Copy link
Member

Sec-ant commented Apr 7, 2024

This PR will make xtask_lintdoc task fail on this "valid" case:

<svg aria-hidden><rect /></svg>

a11y/noSvgWithoutTitle.js:1:1 lint/a11y/noSvgWithoutTitle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Alternative text title element cannot be empty

> 1 │ <svg aria-hidden><rect /></svg>
^^^^^^^^^^^^^^^^^
2 │

For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.

This error can be catched by just gen-lint but it seems our just gen-all won't run all of the just gen-lint tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter A-Website Area: website L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants