Skip to content

Post-merge-review: Fix template-no-input-block false positive in GJS/GTS#2678

Merged
NullVoxPopuli merged 1 commit intoember-cli:masterfrom
johanrd:night_fix/template-no-input-block
Apr 13, 2026
Merged

Post-merge-review: Fix template-no-input-block false positive in GJS/GTS#2678
NullVoxPopuli merged 1 commit intoember-cli:masterfrom
johanrd:night_fix/template-no-input-block

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 13, 2026

What's broken on master

The classic {{input}} helper is not an ambient strict-mode keyword (it is not registered in STRICT_MODE_KEYWORDS, and unlike <Input> from @ember/component it has no angle-bracket equivalent). The rule's docs already declare it "HBS Only" — but the implementation runs in both modes:

import input from './my-input-helper';
<template>{{#input}}content{{/input}}</template>   // false-positive on master

Fix

Gate the rule to .hbs only via filename extension. Mirror the established pattern used by template-deprecated-render-helper, template-deprecated-inline-view-helper, etc.

Test plan

13 tests pass on the branch (was 6). New valid cases:

  • <template>{{#input}}content{{/input}}</template> in .gjs — silently allowed
  • Same in .gts
  • import input from './my-input'; <template>{{#input}}content{{/input}}</template> in .gjs — silently allowed
  • import input from './my-input'; <template>{{#input value=this.foo}}{{/input}}</template> in .gjs — silently allowed (with hash args)

Cowritten by claude

The classic `{{input}}` helper is not an ambient strict-mode keyword
(it is not registered in STRICT_MODE_KEYWORDS, and unlike `<Input>`
from `@ember/component` it has no angle-bracket equivalent). In
.gjs/.gts any `{{#input}}` is necessarily a user-imported binding
(or an unbound name that the strict-mode compiler will reject on its
own), so flagging it here would corrupt the user's intent.

The docs already declare this rule "HBS Only", so this fix makes
that claim true: gate the rule to .hbs only via filename extension.

Tests: 13 (was 6) — adds 4 new valid GJS/GTS cases (bare {{#input}},
GTS variant, with `import input` from a custom path, with hash args).
HBS path is unchanged.
@johanrd johanrd marked this pull request as ready for review April 13, 2026 11:28
@NullVoxPopuli NullVoxPopuli merged commit 1aedbdd into ember-cli:master Apr 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants