Update link lint rule to skip Link with className #193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #192
Related: https://github.com/github/github/pull/328018
This PR modifies the
a11y-link-in-text-block
rule to avoid flaggingLink
in text block if it also has theclassName
on it.The
a11y-link-in-text-block
is aimed at flaggingLink
that do not have distinguishing styles on it, and encourages the use of theinline
prop to underline the link in such scenarios.Sometimes, the
Link
has aclassName
attribute on it to style it differently with CSS classes. In such cases, the rule should skip theLink
because it's possible the CSS class provides sufficient styling. However, the linter cannot actually determine whether the CSS class provides sufficient styling, so this errs on the side of caution and skipsLink
withclassName
entirely to avoid false positive flags.Reviewers
I'm open to your feedback on whether this is the right approach to take, or if there are others I'm not considering.