Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Type error on <Image /> component when strict TypeScript rules are used with library type checking. #10549

Merged
merged 10 commits into from
Mar 26, 2024
5 changes: 5 additions & 0 deletions .changeset/blue-dolls-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Updates the `HTMLAttributes` type exported from `astro` to allow data attributes
5 changes: 4 additions & 1 deletion packages/astro/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import type { Simplify } from './dist/type-utils.js';

/** Any supported HTML or SVG element name, as defined by the HTML specification */
export type HTMLTag = keyof astroHTML.JSX.DefinedIntrinsicElements;

/** The built-in attributes for any known HTML or SVG element name */
export type HTMLAttributes<Tag extends HTMLTag> = Omit<
astroHTML.JSX.IntrinsicElements[Tag],
keyof Omit<AstroBuiltinAttributes, 'class:list'>
>;
> & {
[key: string]: string | number | boolean | null | undefined;
};

/**
* All the CSS properties available, as defined by the CSS specification
Expand Down