typed-ember / glint

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

Glint generates reference comments when using the `TOC` type #697

Open Windvis opened 5 months ago

Windvis commented 5 months ago

I'm adding Glint / TypeScript support to a v1 addon (by converting to .gts) and I noticed that glint -d outputs a reference comment in files where the TOC type is used. When converting it to use a class instead, the references are no longer generated. According to the Discord it might be a TS issue, but I don't rule out any issues in my setup either 😄.

.gts source ```gts import type { TOC } from '@ember/component/template-only'; interface Signature { Blocks: { default: []; }; Element: HTMLDivElement; } const AuApp: TOC = ; export default AuApp; ```
glint -d output ```gts /// /// import type { TOC } from '@ember/component/template-only'; interface Signature { Blocks: { default: []; }; Element: HTMLDivElement; } declare const AuApp: TOC; export default AuApp; //# sourceMappingURL=au-app.d.ts.map ```
After converting to a class ```gts import Component from '@glimmer/component'; interface Signature { Blocks: { default: []; }; Element: HTMLDivElement; } export default class AuApp extends Component {} export {}; //# sourceMappingURL=au-app.d.ts.map ```