Update role-supports-aria-props.md: fix code sample#939
Update role-supports-aria-props.md: fix code sample#939n-chardon wants to merge 1 commit intojsx-eslint:mainfrom
Conversation
| ```jsx | ||
| <!-- Good: the radiogroup role does support the aria-required property --> | ||
| <ul role="radiogroup" aria-required aria-labelledby="foo"> | ||
| <ul role="radiogroup" aria-required="true" aria-labelledby="foo"> |
There was a problem hiding this comment.
There was a problem hiding this comment.
Thanks. It seems like we don't have any rule or option that can catch this currently - @jessebeach, does this seem like a good addition? Perhaps an option to aria-props or something?
There was a problem hiding this comment.
@ljharb and @n-chardon, honestly, it strikes me as something that requires its own rule, something like no-empty-boolean-attributes. The attributes that such a rule would apply to are:
aria-atomic
aria-busy
aria-disabled
aria-modal
aria-multiline
aria-multi selectable
aria-readonly
aria-required
And, confusingly, there is a tri-state version (true/false/undefined) of these "boolean" attributes that allow "undefined", which indicates that the attribute is not applicable. Such a state shouldn't exist, but it exists in the spec, so it needs to be accounted for here:
aria-expanded
aria-grabbed
aria-hidden
aria-selected
A good solution is pulling the properties map from https://github.com/A11yance/aria-query/blob/main/src/ariaPropsMap.js and refactoring it into a util. A better solution is referring to aria-query to get the information about the allowed props and their value types rather than having this information hard-coded in this lint rule plugin.
@n-chardon would you like to write up this rule?
|
Yes, see #937; you can ignore it for now. |


fixes #938