Skip to content

Commit

Permalink
Fix: Type error on <Image /> component when strict TypeScript rules…
Browse files Browse the repository at this point in the history
… are used with library type checking. (#10549)

* hotfix:ts-explicit-error

* add:changeset

* update:changeset

* Update .changeset/blue-dolls-melt.md

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>

* add:types-htmlattribute-extends

* Update .changeset/blue-dolls-melt.md

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>

* Update blue-dolls-melt.md

* addition: allow specifying null type

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
  • Loading branch information
admirsaheta and florian-lefebvre authored Mar 26, 2024
1 parent c585528 commit 54c2f97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 54c2f97

Please sign in to comment.