Skip to content

Extract rule: template-no-unbound#2582

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

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

Conversation

@NullVoxPopuli
Copy link
Copy Markdown
Contributor

Split from #2371.

Copy link
Copy Markdown

@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-unbound (comparing with ember-template-lint no-unbound)

Coverage

The migration looks clean and faithfully reproduces the original rule. The original checks MustacheStatement, BlockStatement, and SubExpression -- this PR correctly maps those to GlimmerMustacheStatement, GlimmerBlockStatement, and GlimmerSubExpression.

What's done well

  • Correct node type mapping: All three visitor types from the original are covered.
  • Error message: Closely matches the original ("Unexpected {{unbound}} usage." vs original "Unexpected {{unbound}} usage."). Essentially identical.
  • Good test coverage: Both .gjs/.gts (via ember-eslint-parser) and .hbs (via ember-eslint-parser/hbs) are tested.
  • templateMode: 'loose' is appropriate since unbound is a legacy helper that wouldn't appear in strict mode.
  • Clean, minimal implementation -- easy to review and maintain.

Observations

  • The original rule checks node.path.original === 'unbound' directly without the ?.type guard. The PR adds node.path?.type === 'GlimmerPathExpression' which is a reasonable defensive check for the ESLint AST. Good.
  • The original test has 2 valid and 2 invalid cases. The PR has 3 valid (adds {{this.value}} for gjs) and 2 invalid per parser mode -- adequate coverage.

Verdict

This is a straightforward, correct migration. No issues found.


🤖 Automated review comparing with ember-template-lint source

@NullVoxPopuli NullVoxPopuli force-pushed the nvp/template-lint-extract-rule-template-no-unbound branch from dd11c1f to 3ba27aa Compare March 21, 2026 03:56
@NullVoxPopuli NullVoxPopuli merged commit 6a244f4 into ember-cli:master Mar 21, 2026
9 checks passed
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