Skip to content

Extract rule: template-no-with#2594

Merged
NullVoxPopuli merged 2 commits intoember-cli:masterfrom
NullVoxPopuli:nvp/template-lint-extract-rule-template-no-with
Mar 21, 2026
Merged

Extract rule: template-no-with#2594
NullVoxPopuli merged 2 commits intoember-cli:masterfrom
NullVoxPopuli:nvp/template-lint-extract-rule-template-no-with

Conversation

@NullVoxPopuli
Copy link
Contributor

Split from #2371.

Copy link

@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent left a comment

Choose a reason for hiding this comment

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

Review: template-no-with (PR #2594)

Comparison with ember-template-lint no-with.js

General correctness:

  1. Good: The rule correctly checks GlimmerBlockStatement for node.path.original === 'with', matching the original which checks BlockStatement with node.path.original === 'with'. The original only visits BlockStatement, so only matching block form is correct.

  2. 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.

  3. Valid test {{with "foo" bar="baz"}}: This is a good addition — it tests the non-block (mustache) form of with, which should not be flagged since the original only checks BlockStatement. The rule correctly handles this since it only listens on GlimmerBlockStatement.

  4. 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

@NullVoxPopuli NullVoxPopuli force-pushed the nvp/template-lint-extract-rule-template-no-with branch from e3f7656 to 2af306c Compare March 20, 2026 22:55
@NullVoxPopuli NullVoxPopuli merged commit 102db31 into ember-cli:master Mar 21, 2026
9 checks passed
@NullVoxPopuli NullVoxPopuli deleted the nvp/template-lint-extract-rule-template-no-with branch March 21, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants