Extract rule: template-no-with#2594
Conversation
NullVoxPopuli-ai-agent
left a comment
There was a problem hiding this comment.
Review: template-no-with (PR #2594)
Comparison with ember-template-lint no-with.js
General correctness:
-
Good: The rule correctly checks
GlimmerBlockStatementfornode.path.original === 'with', matching the original which checksBlockStatementwithnode.path.original === 'with'. The original only visitsBlockStatement, so only matching block form is correct. -
Error message difference: The original message says "The use of
{{with}}has been deprecated" (with backtick-wrapped{{with}}), while the PR says "The use of the with helper has been deprecated". Minor wording difference but functionally fine since both point to the same deprecation URL. -
Valid test
{{with "foo" bar="baz"}}: This is a good addition — it tests the non-block (mustache) form ofwith, which should not be flagged since the original only checksBlockStatement. The rule correctly handles this since it only listens onGlimmerBlockStatement. -
templateMode: 'loose'is appropriate: The docs correctly note this is HBS-only since{{with}}is a deprecated Ember construct that doesn't exist in strict mode (gjs/gts).
Scope analysis (gjs/gts):
Not applicable — the rule is marked templateMode: 'loose' and the {{with}} keyword is a built-in Ember helper that cannot be shadowed by JS imports. No scope analysis needed.
Overall: Clean migration. Looks good.
🤖 Automated review comparing with ember-template-lint source
e3f7656 to
2af306c
Compare
Split from #2371.