Skip to content

Commit

Permalink
update location of report
Browse files Browse the repository at this point in the history
  • Loading branch information
khiga8 committed Jul 19, 2022
1 parent af98a18 commit cd9d7eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rules/a11y-no-generic-link-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ module.exports = {
let cleanTextContent // text content we can reliably fetch

const parent = node.parent
let jsxTextNode
if (parent.children && parent.children.length > 0 && parent.children[0].type === 'JSXText') {
jsxTextNode = parent.children[0]
cleanTextContent = stripAndDowncaseText(parent.children[0].value)
}

Expand All @@ -54,7 +56,7 @@ module.exports = {
if (cleanTextContent) {
if (!bannedLinkText.includes(cleanTextContent)) return
context.report({
node,
node: jsxTextNode,
message:
'Avoid setting generic link text like `Here`, `Click here`, `Read more`. Make sure that your link text is both descriptive and concise.'
})
Expand Down

0 comments on commit cd9d7eb

Please sign in to comment.