-
Notifications
You must be signed in to change notification settings - Fork 9
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
Create a lint rule to encourage inline
prop for <Link>
s in text block
#182
Comments
inline
for <Link>
identified as being within a text blockinline
prop for <Link>
s that are identified as being within a text block
inline
prop for <Link>
s that are identified as being within a text blockinline
prop for <Link>
s in text block
Hello @khiga8 👋 Thanks for raising this issue! We chatted this in our planning session and have some thoughts about the rule, especially the note you left in the description.
If it is going to flag everything, it feels like it can cause friction and get in the way rather than being helpful and it is not ideal. Especially for cases where we need to disable and ignore the rule of the
We talked about ways of finding Link components that have text around and although we think 100% coverage is difficult in this case, but we can still try starting small and growing from there. For example, looking at the markup at dotcom and finding the most common "text" components which might be Would love to hear what you think about all these 🙌 |
Ah I'm sorry that was definitely a typo missing a word 🤦♀ . I meant to say: "Static analysis is limited so this will not flag everything." Let me edit that! I actually have a draft of the lint rule in #183. I've run this against dotcom and it's been able to catch around ~140 instances of Links missing the inline prop. The branch is in draft since I want to verify how it runs against dotcom, but feel free to leave a comment if you have any thoughts. I agree that false positives should be minimized and have outlined a plan in https://github.com/github/accessibility/issues/6434. I'm starting out by opening PRs to fix the instances caught by this draft rule which I've gone ahead and broke up into 8 PRs. My plan is to make sure that there are no false positives raised by this rule, iterate on feedback from the code owners, then open up the lint rule for review if we're confident in it having minimal false positives. Let me know if you have concerns with this! |
No worries and all sounds great!!
Didn't realised already assigned to you 😬 Thanks! |
Problem statement
There is a gap in in-editor tooling to ensure that
Link
s in text block have theinline
prop set on it for accessibility.While we do have the in-browser axe checks to encourage setting
inline
, having tooling as people are writing code is the most impactful/proactive. The in-browser axe checks are limited in coverage.Akin to the lint rule that we've introduced in ERB, there is an opportunity to introduce an ESLint rule in Primer React that nudges setting the
inline
prop for<Link>
when the link is identified as being inside of a block. This would also help prepare for the next major release wheninline
becomes the default.Important note: Static analysis is limited so this will not flag everything. However, it should help improve coverage!
Acceptance criteria
inline
prop.The text was updated successfully, but these errors were encountered: