Linted the whole project with eslint

This commit was merged in pull request #3.
This commit is contained in:
2023-08-31 19:42:15 +02:00
parent cbc4d839d0
commit 7be98e1793
29 changed files with 2931 additions and 1686 deletions

View File

@@ -6,36 +6,36 @@ import { Layout } from "../components/layout";
import { client } from "../tina/__generated__/client";
export default function HomePage(
props: InferGetStaticPropsType<typeof getStaticProps>
props: InferGetStaticPropsType<typeof getStaticProps>
) {
const { data } = useTina(props);
const { data } = useTina(props);
return (
<Layout rawData={data} data={data.global as any}>
<Blocks {...data.page} />
</Layout>
);
return (
<Layout rawData={ data } data={ data.global as any }>
<Blocks { ...data.page } />
</Layout>
);
}
export const getStaticProps = async ({ params }) => {
const tinaProps = await client.queries.contentQuery({
relativePath: `${params.filename}.md`,
});
const props = {
...tinaProps,
enableVisualEditing: process.env.VERCEL_ENV === "preview",
};
return {
props: JSON.parse(JSON.stringify(props)) as typeof props,
};
const tinaProps = await client.queries.contentQuery({
relativePath: `${ params.filename }.md`
});
const props = {
...tinaProps,
enableVisualEditing: process.env.VERCEL_ENV === "preview"
};
return {
props: JSON.parse(JSON.stringify(props)) as typeof props
};
};
export const getStaticPaths = async () => {
const pagesListData = await client.queries.pageConnection();
return {
paths: pagesListData.data.pageConnection?.edges?.map((page) => ({
params: { filename: page?.node?._sys.filename },
})),
fallback: false,
};
const pagesListData = await client.queries.pageConnection();
return {
paths: pagesListData.data.pageConnection?.edges?.map((page) => ({
params: { filename: page?.node?._sys.filename }
})),
fallback: false
};
};