Skip to content

Commit

Permalink
Fix type errors for linter
Browse files Browse the repository at this point in the history
  • Loading branch information
wkirby committed Nov 26, 2024
1 parent ab40d91 commit f866f0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ type BaseButtonProps = {
variant?: "primary" | "secondary" | "tertiary";
size?: "lg" | "sm";
disabled?: boolean;
}
};

type LinkButtonProps = BaseButtonProps & {
href: string;
onClick?: undefined;
} & HTMLProps<HTMLAnchorElement>;
} & Omit<HTMLProps<HTMLAnchorElement>, "size">;

type ButtonButtonProps = BaseButtonProps & {
href?: undefined;
onClick: React.MouseEventHandler<HTMLButtonElement>;
} & HTMLProps<HTMLButtonElement>;

} & Omit<HTMLProps<HTMLButtonElement>, "size">;

type ButtonProps = LinkButtonProps | ButtonButtonProps;

Expand Down
4 changes: 2 additions & 2 deletions src/lib/posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export async function getPostData({
`${year}-${month}-${day}-${slug}.md`,
);
const fileContents = readFileSync(fullPath, "utf8");
const { content, data, desc } = await parseMatter(fileContents);
const { content, data } = await parseMatter(fileContents);
const contentHtml = processMarkdown(content);

return {
Expand All @@ -170,7 +170,7 @@ export async function getPostData({
query: { year, month, day, slug },
},
person: people[data.author] ?? null,
desc,
desc: data.desc,
contentHtml,
...data,
};
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export type FrontmatterData = {
image?: string;
credit?: string;
author?: string;
desc?: string;
};

export type PostFrontmatter = {
content: string;
data: FrontmatterData;
desc?: string;
};

export type PostParams = {
Expand Down

0 comments on commit f866f0a

Please sign in to comment.