-
-
Notifications
You must be signed in to change notification settings - Fork 637
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
Update role-supports-aria-props.md: fix code sample #939
base: main
Are you sure you want to change the base?
Conversation
@@ -13,7 +13,7 @@ This rule takes no arguments. | |||
### Succeed | |||
```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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what needs fixing here exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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