Linter: Fix html-no-unescaped-entities false positive on ActionView tag helpers#1672
Open
bdewater-thatch wants to merge 1 commit into
Conversation
89101c5 to
d33a4d6
Compare
html-no-unescaped-entities false positive on ActionView tag helpers
d33a4d6 to
83fd89c
Compare
Add an escape_content flag to HTMLElementNode so virtual elements created from ActionView helpers can track whether generated content is escaped. Use that flag in html-no-unescaped-entities to avoid false positives for escaped helper content while still linting raw-safe helper output. Update generated bindings and snapshots for the new AST shape.
83fd89c to
2238fc5
Compare
Author
|
@marcoroth rebased and tests should be fixed now, could you kick off another CI run please? |
marcoroth
reviewed
Jun 5, 2026
|
|
||
| get parserOptions(): Partial<ParserOptions> { | ||
| return { | ||
| action_view_helpers: true, |
Owner
There was a problem hiding this comment.
Hey @bdewater-thatch, thanks for taking a stab at fixing this!
I'd need to check, but couldn't we just disable the action_view_tag_helpers option on this linter rule, so that the linter doesn't even see the converted ActionView helpers as HTML nodes?
Or is the automatic escaping only happening on some of the Action View helpers?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#1670 was actually correct, the agent hallucinated the rule being enabled or not 😂
The html-no-unescaped-entities rule flags
&characters inside string arguments to ActionView tag helpers that auto-escape their content by default. Following the suggested fix (&) causes double-escaping and the user sees literal&instead of&.Decided to let it take a stab at fixing it because I don't want people to get too comfortable with disabling this rule.