Skip to content

Post-merge-review: Fix template-no-whitespace-for-layout false positive on attribute values#2681

Merged
NullVoxPopuli merged 3 commits intoember-cli:masterfrom
johanrd:false_positive/template-no-whitespace-for-layout
Apr 15, 2026
Merged

Post-merge-review: Fix template-no-whitespace-for-layout false positive on attribute values#2681
NullVoxPopuli merged 3 commits intoember-cli:masterfrom
johanrd:false_positive/template-no-whitespace-for-layout

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 13, 2026

The rule's GlimmerTextNode visitor fired on attribute value text nodes (e.g. <div class="foo bar">), reporting layout-whitespace violations for consecutive spaces inside class lists and other attribute values.

Upstream ember-template-lint only visits body text, since its HBS parser exposes attribute values differently. Skip GlimmerTextNodes whose parent is a GlimmerAttrNode.

The rule's GlimmerTextNode visitor fired on attribute value text nodes
(e.g. `<div class="foo  bar">`), reporting layout-whitespace violations
for consecutive spaces inside class lists and other attribute values.

Upstream ember-template-lint only visits body text, since its HBS
parser exposes attribute values differently. Skip GlimmerTextNodes
whose parent is a GlimmerAttrNode.
@johanrd johanrd force-pushed the false_positive/template-no-whitespace-for-layout branch from 9018b60 to 92b6d17 Compare April 13, 2026 15:27
@johanrd johanrd marked this pull request as ready for review April 13, 2026 15:31
johanrd added 2 commits April 14, 2026 14:59
Replace the Tailwind-specific valid case with a style attribute example
where consecutive spaces are more clearly intentional. Add a comment
referencing ember-template-lint#2899 to explain why attr values must not
be flagged.
@NullVoxPopuli NullVoxPopuli merged commit a98bbca into ember-cli:master Apr 15, 2026
10 of 11 checks passed
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