delucis / astro-auto-import

Auto-import components in Astro projects
84 stars 2 forks source link

TypeScript check failed #14

Closed recallwei closed 1 year ago

recallwei commented 1 year ago

image Cannot find the astro component.

recallwei commented 1 year ago

Maybe it should generate a .d.ts file automatically?

delucis commented 1 year ago

I actually explored type generation previously — work is in this branch: https://github.com/delucis/astro-auto-import/tree/type-generation

In general I’m not convinced auto-importing is a best practice inside .astro files, so that was a big reason I decided against including type generation in the main release. While I think it can be handy in content files (like MDX), I’d advise against using an auto-import in .astro and to prefer an explicit import instead.

delucis commented 1 year ago

I’m going to drop support for use of auto imports in .astro files in the next release — only MDX will be supported. MDX isn’t type checked, so I’ll close this issue.