Skip to content

Extract rule: template-no-curly-component-invocation#2460

Merged
NullVoxPopuli merged 2 commits intoember-cli:masterfrom
NullVoxPopuli:nvp/template-lint-extract-rule-template-no-curly-component-invocation
Mar 13, 2026
Merged

Extract rule: template-no-curly-component-invocation#2460
NullVoxPopuli merged 2 commits intoember-cli:masterfrom
NullVoxPopuli:nvp/template-lint-extract-rule-template-no-curly-component-invocation

Conversation

@NullVoxPopuli
Copy link
Copy Markdown
Contributor

Split from #2371.

@NullVoxPopuli NullVoxPopuli force-pushed the nvp/template-lint-extract-rule-template-no-curly-component-invocation branch 2 times, most recently from 863b040 to ce5907a Compare March 10, 2026 22:26
@johanrd
Copy link
Copy Markdown
Contributor

johanrd commented Mar 12, 2026

Claude review comparing with ember-template-lint rule: no-curly-component-invocation

⚠️ noImplicitThis accepted but never used

The schema accepts noImplicitThis (default true), but the rule logic never references it. With the default config, {{foo}} should be flagged as a potential component invocation (since it's not prefixed
with this. or @), but it isn't — shouldCheckComponent only checks for dash/slash in the name.

The original (lines 241-244) does:

if (this.config.noImplicitThis && !isExplicitThis && !isLocal) {
  this.logNode({ message: this.generateError(name), node });                                                                                                                                                       
} 

⚠️ Multi-part paths not handled

{{foo.bar baz=qux}} (with hash params) is not flagged. The original has an explicit check for multi-part paths in the hasNamedArguments branch (lines 177-181):

  if (path.parts.length > 1) {
    // {{foo.bar bar=baz}}                                                                                                                                                                                           
    this.logNode({ message: this.generateError(name), node });
    return;                                                                                                                                                                                                          
  }        

Similarly, {{foo.bar}} (without hash params) should be flagged when noImplicitThis: true and the path isn't this./@/local — the original handles this at lines 209-216.

⚠️ Missing isLocal/isExplicitThis checks

The original distinguishes block params and explicit this./@ paths from ambiguous names. Without these checks:

  • {{this.foo}} and {{@foo}} could be incorrectly flagged
  • Block params like {{#each items as |item|}}{{item}}{{/each}} aren't exempted from noImplicitThis (works by accident since item has no dash, but breaks for disallow config)

The original tracks scope via this.isLocal(path) and checks path.this || path.data (lines 206-207). A scope-tracking pattern already exists in this repo — see template-no-obsolete-elements.js lines 53-65 using
blockParamsInScope with GlimmerBlockStatement/GlimmerBlockStatement:exit.

Not sure if all of these difrerences are meaningful for a port though, just flagging them

@NullVoxPopuli NullVoxPopuli force-pushed the nvp/template-lint-extract-rule-template-no-curly-component-invocation branch from ce5907a to cc208d4 Compare March 13, 2026 01:21
@NullVoxPopuli NullVoxPopuli merged commit 24ae541 into ember-cli:master Mar 13, 2026
11 checks passed
NullVoxPopuli added a commit that referenced this pull request Mar 14, 2026
Post-merge review of #2460 (`template-no-curly-component-invocation`)
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