withastro/language-tools

๐Ÿ› BUG: Using a property as a dynamic tag marks TS props as unused

Closed this issue ยท 1 comments

Describe the Bug

When using code like this:

---
interface Props {
  as: string;
}

const { as } = Astro.props;
const As = as;
---

<As>
  <slot />
</As>

And running pnpm astro check it shows an error:

error ts(6196): 'Props' is declared but never used.

Steps to Reproduce

  1. npm init astro using template
  2. Use the code above in a component
  3. Run pnpm astro check
  4. Error! error ts(6196): 'Props' is declared but never used.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/astro-check-errors?file=src%2Fcomponents%2FCard.astro&on=stackblitz