Skip to content

Commit cd9d7eb

Browse files
committed
update location of report
1 parent af98a18 commit cd9d7eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/rules/a11y-no-generic-link-text.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ module.exports = {
2929
let cleanTextContent // text content we can reliably fetch
3030

3131
const parent = node.parent
32+
let jsxTextNode
3233
if (parent.children && parent.children.length > 0 && parent.children[0].type === 'JSXText') {
34+
jsxTextNode = parent.children[0]
3335
cleanTextContent = stripAndDowncaseText(parent.children[0].value)
3436
}
3537

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

0 commit comments

Comments
 (0)