chore: replace eslint & prettier w/ biomejs (#21)
* chore: replace eslint & prettier w/ biomejs * fix syntax error in ci.yml workflow * ensure that build CI jobs only run if check job succeeds to save resources
This commit is contained in:
parent
d67e4c81ad
commit
e319626a1a
44 changed files with 2408 additions and 5691 deletions
|
|
@ -7,46 +7,46 @@
|
|||
* An in-memory representation of a renderable HTML element.
|
||||
*/
|
||||
export interface HTMLElement {
|
||||
/**
|
||||
* Name of the tag that gets output upon rendering.
|
||||
*/
|
||||
tag: string;
|
||||
/**
|
||||
* Record of attribute names and values that should be output in the opening
|
||||
* tag.
|
||||
*/
|
||||
attributes: Record<string, string | number | boolean>;
|
||||
/**
|
||||
* Child elements to render nested within this HTML element.
|
||||
*/
|
||||
children: Element[];
|
||||
/**
|
||||
* Name of the tag that gets output upon rendering.
|
||||
*/
|
||||
tag: string;
|
||||
/**
|
||||
* Record of attribute names and values that should be output in the opening
|
||||
* tag.
|
||||
*/
|
||||
attributes: Record<string, string | number | boolean>;
|
||||
/**
|
||||
* Child elements to render nested within this HTML element.
|
||||
*/
|
||||
children: Element[];
|
||||
}
|
||||
|
||||
/**
|
||||
* All valid types of elements that can be rendered to HTML.
|
||||
*/
|
||||
export type Element =
|
||||
| Element[]
|
||||
| HTMLElement
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined
|
||||
| null;
|
||||
| Element[]
|
||||
| HTMLElement
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined
|
||||
| null;
|
||||
|
||||
/**
|
||||
* Custom HTMLElement factory that can be parameterized by props.
|
||||
*/
|
||||
export interface Component<P extends object = {}> {
|
||||
(
|
||||
props: P & {
|
||||
children?: Element[];
|
||||
},
|
||||
): HTMLElement;
|
||||
export interface Component<P extends object = Record<string, unknown>> {
|
||||
(
|
||||
props: P & {
|
||||
children?: Element[];
|
||||
},
|
||||
): HTMLElement;
|
||||
}
|
||||
|
||||
export const Fragment: Component<{}> = ({ children }) => ({
|
||||
tag: "#fragment",
|
||||
attributes: {},
|
||||
children: children || [],
|
||||
export const Fragment: Component = ({ children }) => ({
|
||||
tag: "#fragment",
|
||||
attributes: {},
|
||||
children: children || [],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue