Skip to content

Commit 590fc8f

Browse files
committed
Use Biome instead of prettier and eslint.
1 parent 83d4f29 commit 590fc8f

File tree

134 files changed

+838
-1682
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+838
-1682
lines changed

.prettierignore renamed to .biomeignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ bun.lockb
1010

1111
# Cache
1212
.cache/
13-
.eslintcache
1413

1514
# Logs
1615
*.log
@@ -29,4 +28,5 @@ yarn-error.log*
2928
.DS_Store
3029
*.pem
3130
coverage/
32-
.vercel
31+
.vercel
32+

.eslintignore

Lines changed: 0 additions & 22 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 47 deletions
This file was deleted.

.prettierrc.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

app/api/docs/search-index/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import fs from "fs";
2-
import path from "path";
1+
import fs from "node:fs";
2+
import path from "node:path";
33

44
import matter from "gray-matter";
55
import { NextResponse } from "next/server";

app/api/og/route.tsx

Lines changed: 57 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ImageResponse } from "@vercel/og";
2-
import { NextRequest } from "next/server";
2+
import type { NextRequest } from "next/server";
33

44
export const runtime = "edge";
55

@@ -12,87 +12,86 @@ export async function GET(req: NextRequest) {
1212
const image = searchParams.get("image") || "https://eternalcode.pl/logo.svg";
1313

1414
return new ImageResponse(
15-
(
15+
<div
16+
style={{
17+
height: "100%",
18+
width: "100%",
19+
display: "flex",
20+
flexDirection: "column",
21+
alignItems: "center",
22+
justifyContent: "center",
23+
backgroundColor: "#ffffff",
24+
padding: "40px 80px",
25+
fontFamily: "Poppins, sans-serif",
26+
}}
27+
>
1628
<div
1729
style={{
18-
height: "100%",
19-
width: "100%",
2030
display: "flex",
21-
flexDirection: "column",
31+
flexDirection: "row",
2232
alignItems: "center",
2333
justifyContent: "center",
24-
backgroundColor: "#ffffff",
25-
padding: "40px 80px",
26-
fontFamily: "Poppins, sans-serif",
34+
marginBottom: "40px",
2735
}}
2836
>
37+
{/** biome-ignore lint/performance/noImgElement: it's for og image, i cant use <Image> here */}
38+
<img
39+
src={image}
40+
alt="EternalCode Logo"
41+
width={120}
42+
height={120}
43+
style={{ marginRight: "20px" }}
44+
/>
2945
<div
3046
style={{
3147
display: "flex",
32-
flexDirection: "row",
33-
alignItems: "center",
48+
flexDirection: "column",
49+
alignItems: "flex-start",
3450
justifyContent: "center",
35-
marginBottom: "40px",
3651
}}
3752
>
38-
<img
39-
src={image}
40-
alt="EternalCode Logo"
41-
width={120}
42-
height={120}
43-
style={{ marginRight: "20px" }}
44-
/>
45-
<div
53+
<h1
4654
style={{
47-
display: "flex",
48-
flexDirection: "column",
49-
alignItems: "flex-start",
50-
justifyContent: "center",
55+
fontSize: "60px",
56+
fontWeight: "bold",
57+
color: "#0d1117",
58+
margin: "0",
59+
lineHeight: "1.2",
5160
}}
5261
>
53-
<h1
54-
style={{
55-
fontSize: "60px",
56-
fontWeight: "bold",
57-
color: "#0d1117",
58-
margin: "0",
59-
lineHeight: "1.2",
60-
}}
61-
>
62-
{title}
63-
</h1>
64-
<p
65-
style={{
66-
fontSize: "30px",
67-
color: "#3b82f6",
68-
margin: "0",
69-
marginTop: "10px",
70-
}}
71-
>
72-
{subtitle}
73-
</p>
74-
</div>
75-
</div>
76-
<div
77-
style={{
78-
display: "flex",
79-
alignItems: "center",
80-
justifyContent: "center",
81-
marginTop: "20px",
82-
}}
83-
>
62+
{title}
63+
</h1>
8464
<p
8565
style={{
86-
fontSize: "24px",
87-
color: "#6b7280",
66+
fontSize: "30px",
67+
color: "#3b82f6",
8868
margin: "0",
69+
marginTop: "10px",
8970
}}
9071
>
91-
eternalcode.pl
72+
{subtitle}
9273
</p>
9374
</div>
9475
</div>
95-
),
76+
<div
77+
style={{
78+
display: "flex",
79+
alignItems: "center",
80+
justifyContent: "center",
81+
marginTop: "20px",
82+
}}
83+
>
84+
<p
85+
style={{
86+
fontSize: "24px",
87+
color: "#6b7280",
88+
margin: "0",
89+
}}
90+
>
91+
eternalcode.pl
92+
</p>
93+
</div>
94+
</div>,
9695
{
9796
width: 1200,
9897
height: 630,

app/author/[slug]/page.tsx

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
import Image from "next/image";
2-
import { notFound } from "next/navigation";
3-
4-
import { AnimatedSection, AnimatedContainer, AnimatedElement } from "@/components/animations";
5-
import BlogPostCard from "@/components/blog/BlogPostCard";
61
import { Pagination } from "@/components/ui/pagination";
72
import { getAuthorBySlug, getBlogPostsByAuthor } from "@/lib/strapi";
3+
import BlogPostCard from "@/components/blog/BlogPostCard";
84
import { getImageUrl } from "@/lib/utils";
5+
import Image from "next/image";
6+
import { AnimatedContainer, AnimatedElement, AnimatedSection } from "@/components/animations";
7+
import { notFound } from "next/navigation";
98

10-
export async function generateMetadata(props: { params: Promise<{ slug: string }> }) {
11-
const { params } = await props;
12-
const { slug } = await params;
9+
interface AuthorPageProps {
10+
params: { slug: string };
11+
searchParams?: { page?: string };
12+
}
13+
14+
export async function generateMetadata({ params }: { params: { slug: string } }) {
15+
const { slug } = params;
1316
const author = await getAuthorBySlug(slug);
17+
1418
if (!author) {
1519
return {
1620
title: "Author Not Found | EternalCode.pl",
1721
description: "This author does not exist on EternalCode.pl.",
1822
};
1923
}
24+
2025
return {
2126
title: `${author.name} – Author | EternalCode.pl`,
2227
description: author.bio || `Read articles by ${author.name} on EternalCode.pl`,
@@ -26,11 +31,9 @@ export async function generateMetadata(props: { params: Promise<{ slug: string }
2631
type: "profile",
2732
url: `https://eternalcode.pl/author/${author.slug}`,
2833
images: author.avatar?.url ? [getImageUrl(author.avatar.url)] : [],
29-
profile: {
30-
firstName: author.name.split(" ")[0],
31-
lastName: author.name.split(" ").slice(1).join(" ") || undefined,
32-
username: author.slug,
33-
},
34+
firstName: author.name.split(" ")[0],
35+
lastName: author.name.split(" ").slice(1).join(" ") || undefined,
36+
username: author.slug,
3437
},
3538
twitter: {
3639
card: "summary",
@@ -44,19 +47,17 @@ export async function generateMetadata(props: { params: Promise<{ slug: string }
4447
};
4548
}
4649

47-
export default async function AuthorPage(props: {
48-
params: Promise<{ slug: string }>;
49-
searchParams: Promise<{ page?: string }>;
50-
}) {
51-
const { params, searchParams } = await props;
52-
const { slug } = await params;
53-
const resolvedSearchParams = await searchParams;
50+
export default async function AuthorPage({ params, searchParams }: AuthorPageProps) {
51+
const { slug } = params;
52+
5453
if (!slug) notFound();
54+
5555
const author = await getAuthorBySlug(slug);
5656
if (!author) notFound();
57+
5758
const posts = await getBlogPostsByAuthor(slug);
5859
const ITEMS_PER_PAGE = 6;
59-
const currentPage = Math.max(1, parseInt(resolvedSearchParams?.page || "1", 10));
60+
const currentPage = Math.max(1, parseInt(searchParams?.page || "1", 10));
6061
const totalPages = Math.ceil(posts.length / ITEMS_PER_PAGE);
6162
const paginatedPosts = posts.slice(
6263
(currentPage - 1) * ITEMS_PER_PAGE,
@@ -67,13 +68,12 @@ export default async function AuthorPage(props: {
6768
<div className="min-h-screen bg-lightGray-100 pb-12 pt-40 dark:bg-gray-900">
6869
<div className="mx-auto max-w-screen-xl px-4">
6970
<div className="mx-auto grid max-w-screen-xl grid-cols-1 gap-12 md:grid-cols-3">
70-
{/* avatar, bio, email - STICKY */}
7171
<aside className="md:col-span-1">
7272
<AnimatedSection
7373
animationType="fadeLeft"
7474
className="sticky top-32 flex flex-col items-start"
7575
>
76-
{author.avatar && author.avatar.url && (
76+
{author.avatar?.url && (
7777
<Image
7878
src={getImageUrl(author.avatar.url)}
7979
alt={author.name}
@@ -101,7 +101,6 @@ export default async function AuthorPage(props: {
101101
</AnimatedSection>
102102
</aside>
103103

104-
{/* articles */}
105104
<main className="md:col-span-2">
106105
<h2 className="mb-6 text-2xl font-bold text-gray-900 dark:text-white">Articles</h2>
107106
{posts.length > 0 ? (

app/blog/[slug]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { notFound } from "next/navigation";
66
import { AnimatedSection } from "@/components/animations";
77
import BlogPostContent from "@/components/blog/BlogPostContent";
88
import { generateOgImageUrl } from "@/lib/og-utils";
9-
import { getBlogPost, StrapiTag } from "@/lib/strapi";
9+
import { getBlogPost, type StrapiTag } from "@/lib/strapi";
1010

1111
export const dynamic = "force-dynamic";
1212
export const revalidate = 5;
@@ -126,7 +126,7 @@ export default async function BlogPostPage({ params }: { params: Promise<{ slug:
126126
{post.excerpt}
127127
</p>
128128
<div className="mb-4 flex flex-wrap items-center gap-4 text-sm text-gray-500 dark:text-gray-400">
129-
{post.author && post.author.slug && (
129+
{post.author?.slug && (
130130
<Link
131131
href={`/author/${post.author.slug}`}
132132
className="flex items-center gap-2 transition-colors hover:text-blue-600 dark:hover:text-blue-400"

app/blog/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BookOpen, Users, Tag } from "lucide-react";
2-
import { Metadata } from "next";
2+
import type { Metadata } from "next";
33

44
import { AnimatedSection, AnimatedContainer, AnimatedElement } from "@/components/animations";
55
import BlogPostCard from "@/components/blog/BlogPostCard";

0 commit comments

Comments
 (0)