-
Notifications
You must be signed in to change notification settings - Fork 10
Add new rule a11y-no-title-usage
#316
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
Conversation
🦋 Changeset detectedLatest commit: 0c278b7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
docs/rules/a11y-no-title-usage.md
Outdated
const App = () => <RelativeTime date={new Date('2020-01-01T00:00:00Z')} /> | ||
``` | ||
|
||
The `noTitle` attribute can be omitted because its default value is `true` internally. |
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.
Maybe "The noTitle
attribute is true
by default, so it can be omitted." is a bit easier to read? Just nit picking here
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.
I like this, your suggestion reads better! Thank you 😄
|
||
The `noTitle` attribute can be omitted because its default value is `true` internally. | ||
|
||
## With alternative tooltip |
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.
Great to have this example ❤️
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.
Very nice ✨
Adds new rule
a11y-no-title-usage
.This rule recommends that consumers do not utilize the title attribute with the RelativeTime component. This attribute is inherent to the component, so adding the prop noTitle is currently necessary.
The suggested paths for remediating violations found through this rule are:
Tooltip
in with an interactive elementtitle
date adjacent or near theRelativeTime
componenttitle
if it isn't neededQuestions for reviewers:
relative-time-element
, so should the name referencerelative-time-element
?noTitle
will also be deprecatedContext: https://github.com/github/primer/issues/4769