Skip to content

Post-merge-review: Fix template-no-invalid-link-text: skip when link contains non-text children#2680

Merged
NullVoxPopuli merged 2 commits intoember-cli:masterfrom
johanrd:false_positive/template-no-invalid-link-text
Apr 14, 2026
Merged

Post-merge-review: Fix template-no-invalid-link-text: skip when link contains non-text children#2680
NullVoxPopuli merged 2 commits intoember-cli:masterfrom
johanrd:false_positive/template-no-invalid-link-text

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 13, 2026

Match upstream ember-template-lint's no-invalid-link-text behavior (lib/rules/no-invalid-link-text.js L53-56): if any child of the link is not a TextNode, the link content is opaque and should not be flagged. Handles real-world patterns like where the link text comes from a component's template, which the linter cannot analyze.

Removes two tests that asserted stricter-than-upstream behavior on click here. Per upstream, this case can't be reliably analyzed and should not be flagged.

…hildren

Match upstream ember-template-lint's no-invalid-link-text behavior (lib/rules/no-invalid-link-text.js
L53-56): if any child of the link is not a TextNode, the link content is opaque
and should not be flagged. Handles real-world patterns like <a><MyComponent />
</a> where the link text comes from a component's template, which the linter
cannot analyze.

Removes two tests that asserted stricter-than-upstream behavior on
<a><span>click here</span></a>. Per upstream, this case can't be reliably
analyzed and should not be flagged.
@johanrd johanrd marked this pull request as ready for review April 13, 2026 15:17
if (result.hasDynamic) {
hasDynamic = true;
}
// Match upstream: if the link contains any non-TextNode child (component,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments explaining what go in the PR description don't mke sense :p

@NullVoxPopuli NullVoxPopuli merged commit 26de552 into ember-cli:master Apr 14, 2026
11 checks passed
@johanrd johanrd deleted the false_positive/template-no-invalid-link-text branch April 14, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants