typed-ember / glint

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

Incompatibility between Ember with the native types and `ts-reset` #643

Closed boris-petrov closed 11 months ago

boris-petrov commented 11 months ago

Repo.

Check tests/types/foo.ts. It gives a strange error:

tests/types/foo.ts:11:7 - error TS2345: Only primitive values and certain DOM objects (see `ContentValue` in `@glint/template`) are usable as top-level template content.
  Argument of type 'UnmetExpectation<"Expected type to be `number`, but got", unknown>' is not assignable to parameter of type 'ContentValue'.

11       {{@expectTypeOf number @to.beNumber}}
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you remove import '@total-typescript/ts-reset/filter-boolean'; from types/global.d.ts, it works fine. It also seems to work fine using the @types/ember__* packages instead of the "native" types.

Any ideas why that happens?