Skip to content

Commit 6628801

Browse files
committed
lint
1 parent af61d82 commit 6628801

File tree

6 files changed

+66
-43
lines changed

6 files changed

+66
-43
lines changed

src/components/Footer.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2+
import { css } from "styled-system/css";
23
import { HStack } from "styled-system/jsx";
34
import { Container } from "styled-system/jsx";
45
---
56

6-
<footer>
7-
<Container borderTopWidth="base">
7+
<footer class={css({ borderTopWidth: "base" })}>
8+
<Container>
89
<HStack height="12" justify="space-between">
910
<span class="caret-blink">TheComputerM</span>
1011
{new Date().getFullYear()}

src/components/ProjectCard.astro

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@ import { octokit } from "~/content/projects/client";
66
import { Card } from "./ui/Card";
77
88
interface Props {
9-
project: CollectionEntry<"projects">;
9+
project: CollectionEntry<"projects">;
1010
}
1111
1212
const { project } = Astro.props;
1313
const [owner, repoName] = project.data.repo.split("/");
1414
const { data: repository } = await octokit.request(
15-
"GET /repos/{owner}/{repo}",
16-
{
17-
owner,
18-
repo: repoName,
19-
},
15+
"GET /repos/{owner}/{repo}",
16+
{
17+
owner,
18+
repo: repoName,
19+
},
2020
);
2121
2222
const links = Object.entries(
23-
Object.assign(
24-
{
25-
Homepage: repository.homepage ?? "",
26-
},
27-
project.data.links,
28-
),
23+
Object.assign(
24+
{
25+
Homepage: repository.homepage ?? "",
26+
},
27+
project.data.links,
28+
),
2929
)
30-
.filter(([, value]) => !!value)
31-
.map(([key, value]) => [key, { href: value, text: value }] as const);
30+
.filter(([, value]) => !!value)
31+
.map(([key, value]) => [key, { href: value, text: value }] as const);
3232
3333
links.unshift([
34-
"GitHub",
35-
{ href: `https://github.com/${project.data.repo}`, text: project.data.repo },
34+
"GitHub",
35+
{ href: `https://github.com/${project.data.repo}`, text: project.data.repo },
3636
]);
3737
3838
const { Content } = await render(project);

src/content.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const projects = defineCollection({
1919
name: z.string(),
2020
repo: z.string(),
2121
next: z.string().optional(),
22-
links: z.record(z.string()).optional()
22+
links: z.record(z.string()).optional(),
2323
}),
2424
});
2525

src/layouts/BaseLayout.astro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,24 @@ const {
3434
<Footer transition:persist="footer" />
3535
</body>
3636
</html>
37+
38+
<script>
39+
console.log("You expected some error logs, BUT IT WAS ME, %cDIO!", "color: yellow; font-size: 2em; font-weight: bolder;");
40+
console.log(`
41+
⣿⣿⣿⣿⣿⡧⣻⣿⣿⡿⣿⣱⣿⣿⣿⢿⡿⢿⣟⣿⣿⣮⡻⣿⣿⣿⣿⣿⣿⣿
42+
⣿⣿⣿⣿⣿⡗⣿⣿⣿⡷⢽⠚⡿⢿⡆⡙⢿⡌⡻⣎⠿⠿⠿⠮⠛⢿⣿⣿⣿⣟
43+
⣿⣿⣿⣔⡶⢾⣿⣿⣿⡔⢈⣠⠃⣷⠃⢫⢢⣭⠙⠶⣧⡉⠻⡿⣻⢭⢹⣿⣿⣿
44+
⣿⣿⣿⣿⡏⢎⣿⡏⡆⠃⢼⡟⡇⠋⠀⠁⡁⠠⣠⣾⣿⣿⣷⢳⡇⡭⣏⣿⣿⣿
45+
⣿⣿⣿⣿⣧⣍⠋⣿⢡⠠⠁⠂⢳⣂⣤⣼⣧⣴⣿⣿⣿⣿⣿⣼⣧⣵⠏⣿⣿⢇
46+
⣿⣿⣿⣿⣯⣥⣥⢉⢙⢧⢶⣶⢨⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡍⣥⣾⣿⣿⣻
47+
⣿⣿⣿⣿⣿⣿⣿⣾⣾⣷⡘⣿⣦⢷⡾⢿⣛⠛⢃⣿⣿⣿⣿⣿⣿⡙⢿⢿⣿⡝
48+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣜⢿⣆⠨⢓⣤⣶⢸⣿⣿⣿⡿⣫⣾⡿⠜⣾⣿⣿
49+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡻⣇⣩⣭⣡⣾⣿⡿⣫⣾⢧⣿⣵⣿⡹⢯⢫
50+
⡟⣩⣷⣜⢿⡿⣿⣛⣻⣿⣿⣿⣿⣿⣞⣷⣶⣿⢟⣫⣾⣿⣿⣾⣿⣿⡿⣗⣥⢾
51+
⣷⣭⣭⢿⡬⣾⡿⣫⣵⣿⣿⣿⡟⠫⣙⣦⡴⣾⣿⢿⣛⣯⣭⡿⢶⣞⣫⣽⣾⣿
52+
⣷⣿⣿⢈⣴⡎⣵⣿⣿⣿⣿⣿⣧⢭⣶⡪⢳⡋⡵⣫⣷⣶⣾⣿⣿⣿⣿⣿⣿⣿
53+
⣟⢿⣫⣾⡟⣼⣿⣿⣿⣿⣿⣿⡿⣸⣿⣿⣇⢞⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
54+
⣵⣿⣿⡟⣽⡿⢿⣻⣯⣷⣶⣿⣿⣮⡻⣿⠘⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
55+
⣿⡿⢏⣬⣷⣾⣿⣿⣿⣿⣿⣿⣿⠟⣡⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
56+
`);
57+
</script>

src/layouts/app.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
font-weight: var(--font-weights-bold);
2525
}
2626

27-
2827
p:not(:last-child) {
2928
margin-bottom: var(--line-heights-base);
3029
}

src/pages/projects/[page].astro

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,39 @@ import { ProjectPagination } from "~/components/ProjectPagination";
88
import BaseLayout from "~/layouts/BaseLayout.astro";
99
1010
export const getStaticPaths = (async ({ paginate }) => {
11-
const projects = await getCollection("projects");
12-
const priorityMap = new Map<string, number>();
13-
const projectMap = new Map<string, CollectionEntry<"projects">>(projects.map((project) => [project.id, project]));
11+
const projects = await getCollection("projects");
12+
const priorityMap = new Map<string, number>();
13+
const projectMap = new Map<string, CollectionEntry<"projects">>(
14+
projects.map((project) => [project.id, project]),
15+
);
1416
15-
function getPriority(project: CollectionEntry<"projects">) {
16-
if (priorityMap.has(project.id)) {
17-
return priorityMap.get(project.id) as number;
18-
}
17+
function getPriority(project: CollectionEntry<"projects">) {
18+
if (priorityMap.has(project.id)) {
19+
return priorityMap.get(project.id) as number;
20+
}
1921
20-
let priority = 0;
21-
if (project.data.next) {
22-
const nextProject = projectMap.get(project.data.next);
23-
if (!nextProject) {
24-
throw new Error(`Project with ID ${project.data.next} not found`);
25-
}
26-
priority = getPriority(nextProject) + 1;
27-
}
28-
priorityMap.set(project.id, priority);
29-
return priority;
30-
}
22+
let priority = 0;
23+
if (project.data.next) {
24+
const nextProject = projectMap.get(project.data.next);
25+
if (!nextProject) {
26+
throw new Error(`Project with ID ${project.data.next} not found`);
27+
}
28+
priority = getPriority(nextProject) + 1;
29+
}
30+
priorityMap.set(project.id, priority);
31+
return priority;
32+
}
3133
32-
for (const project of projects) getPriority(project);
34+
for (const project of projects) getPriority(project);
3335
34-
// biome-ignore lint/style/noNonNullAssertion: calculated priority for all projects
35-
projects.sort((a, b) => priorityMap.get(b.id)! - priorityMap.get(a.id)!);
36+
// biome-ignore lint/style/noNonNullAssertion: calculated priority for all projects
37+
projects.sort((a, b) => priorityMap.get(b.id)! - priorityMap.get(a.id)!);
3638
37-
return paginate(projects, { pageSize: 3 });
39+
return paginate(projects, { pageSize: 3 });
3840
}) satisfies GetStaticPaths;
3941
4042
interface Props {
41-
page: Page<CollectionEntry<"projects">>;
43+
page: Page<CollectionEntry<"projects">>;
4244
}
4345
4446
const { page } = Astro.props;

0 commit comments

Comments
 (0)