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
Implement global settings #174
Comments
hoohoo! Are you thinking that we could map custom components to html elements? like
|
I’d still find value in this, fwiw. |
@evcohen Was this abandoned? I see that you closed this with without referencing any commit, PR or other explanation. |
This would really help when using jsx-a11y with |
@karltaylor code examples would really help frame the enhancement. Could you post a few here? |
Would love to see this working. Currently having trouble with <label htmlFor={id}>
<Checkbox id={id}/> Click Me!
</label> Could be solved by: settings:
components:
input: ["Checkbox"] |
Considering this was closed without explanation, and I'd still like to see it happen, I'm going to reopen - @evcohen please feel free to re-close, but it'd be great to understand why :-) |
any progress on this? |
Any updates on this? I really love this tool and recommend it everywhere I can. Establishing an API for mapping custom components and attributes to their equivalent semantic element would add a lot of power. I'd love a way to lint Gatsby's components (e.g. |
Bump! Our company would love this for usage with styled components. It looks like individual rules support a mapping of the HTML element to custom components, but maintaining those maps on a per-rule basis is prohibitively tedious and difficult to scale/maintain. The solution proposed here - a global mapping of elements to components - would be fantastic. 🎉 |
This is a really good point. Any implementation should not only consider element mappings but also attribute mappings for custom props (per component) as well as disabling certain rules. Certain required aria attributes might be already set for custom components. |
I've started a change in #844, if anyone wants to comment on the API I've chosen and my implementation. If you like it, I'll finish the remaining rules and add proper documentation. |
Love to see that #844 is merged! I'm very much looking forward to seeing those changes land in a published release. Any thoughts on when that might happen? As of now, the README documentation reflects support for global settings, but that's not yet the case 😞 |
@smithki on every repo on github, the readme on the default branch won't necessarily match the last published version, and you have to Just Know to change to a tag to see that version's docs. There's no planned release time, but hopefully soon. |
v6.6.0 is released. |
I think #844 has resolved this, so I'm going to close. If I'm wrong, what would be most helpful is filing a new issue that details any gaps, and why they're needed. |
Discussed in #65. We can provide global settings API for users to specify mappings from low-level DOM elements to their associated wrapper component. This allows us to better apply the ruleset over a codebase. It can also have configuration options for
ARIA
convention for props (i.e. camel-casing likeariaExpanded
or justexpanded
) that map to respectiveARIA
properties. Also contains a special property forrole
since that sometimes has conflicts (as seen in #166).Can look something like this:
The text was updated successfully, but these errors were encountered: