typed-ember / glint

TypeScript powered tooling for Glimmer templates
https://typed-ember.gitbook.io/glint
MIT License
108 stars 50 forks source link

Glint can't handle `hbs` (from ember-cli-htmlbars) while in a gjs file. #705

Open NullVoxPopuli opened 3 months ago

NullVoxPopuli commented 3 months ago

I would expect hbs would be ignored while folks incrementally migrate their tests.

For example:

test('...', async function (assert) {
  const Foo = <template>hi</template>;
  this.Foo = Foo;

  await render(hbs`<this.Foo />`);
}

instead what happens is that you get this error:

> glint

tests/integration/modifiers/ugh-test.gjs:13:36 - error TS1109: Expression expected.

13   await render(hbs`text <this.Foo />`);
                                      ~

tests/integration/modifiers/ugh-test.gjs:16:1 - error TS1160: Unterminated template literal.

16 
full file / repro ```gjs import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; module('...', function (hooks) { setupRenderingTest(hooks); test('...', async function (assert) { const Foo = ; this.Foo = Foo; await render(hbs`text `); }); }); ```