Are there any type definitions for JSX in astro?

Viewed 24

@typescript-eslint/no-unsafe-return rule doesn't work well with .astro files, because the return type of any jsx is any, so any .map results in no-unsafe-return rule error.

---
const cards = [
    {
        href:"https://docs.astro.build/",
        title:"Documentation",
        body:"Learn how Astro works and explore the official API docs.",
    },
    {
        href: "https://astro.build/integrations/",
        title: "Integrations",
        body: "Supercharge your project with new frameworks and libraries.",
    },
    {
        href: "https://astro.build/themes/",
        title: "Themes",
        body: "Explore a galaxy of community-built starter themes.",
    }
];
---

<main>
    {cards.map((card) => (
        // next line has following error: Unsafe return of an `any` typed value. eslint(@typescript-eslint/no-unsafe-return)
        <div>{card.href}</div>
    ))}
</main>

Are there any type definitions for astro jsx? I found some types inside node_modules/astro/astro-jsx.d.ts, but I'm not sure how to use them.

0 Answers
Related