dequelabs / axe-core

Accessibility engine for automated Web UI testing
https://www.deque.com/axe/
Mozilla Public License 2.0
5.75k stars 746 forks source link

With linting, how to handle custom React object that could be transcribed into various HTML elements #4488

Open jasonhocker opened 3 weeks ago

jasonhocker commented 3 weeks ago

Product

axe Linter

Question

For an object that may produce different HTML based on attributes, how would you define that as a global-components in axe-linter.yaml? I am thinking that Typography from @mui https://mui.com/material-ui/react-typography/ is like that. If I have but it may produce different h1 h2... based on the variant attribute in our component library, how would I map that? Is the @mui version simply a global-components mapping or is it special?

straker commented 3 weeks ago

Thanks for the question. At the moment this in't supported. It's a feature we're aware of but haven't figured out how we're going to handle it yet.