Skip to content

Commit

Permalink
chore: eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartek532 committed Feb 19, 2025
1 parent 1b4ff47 commit 562c55b
Show file tree
Hide file tree
Showing 163 changed files with 4,844 additions and 4,419 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

80 changes: 0 additions & 80 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/nextjs_bundle_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: npx -p nextjs-bundle-analysis report

- name: Upload bundle
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bundle
path: .next/analyze/__bundle_analysis.json
Expand Down
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Hero } from "@/components/about/hero";
import { Recommendations } from "@/components/about/recommendation";
import { Skills } from "@/components/about/skills";
import { GitHubActivity } from "@/components/home/github-activity";
import { getMetadata } from "lib/metadata";
import { getMetadata } from "@/lib/metadata";

const description = "I'm a Software Engineer not afraid of any technology 🎓";

Expand Down
24 changes: 13 additions & 11 deletions app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { Article, WithContext } from "schema-dts";

import { FeaturedPosts } from "@/components/blog/featured-posts";
import { Resource } from "@/components/resource/resource";
import { getMetadata } from "lib/metadata";
import { getNewestPosts, getPostBySlug, getPostsPaths } from "lib/posts";
import { type MetadataParams } from "types";
import { SITE_TITLE } from "utils/consts";
import { getMetadata } from "@/lib/metadata";
import { getNewestPosts, getPostBySlug, getPostsPaths } from "@/lib/posts";
import { SITE_TITLE } from "@/utils/consts";

import type { MetadataParams } from "@/types";
import type { Article, WithContext } from "schema-dts";

export async function generateMetadata({ params: { slug } }: MetadataParams) {
const { frontmatter } = await getPostBySlug(slug);
export async function generateMetadata({ params }: MetadataParams) {
const { slug } = await params;
const { frontmatter } = getPostBySlug(slug);

return getMetadata({
title: frontmatter.title,
Expand All @@ -25,11 +26,12 @@ export function generateStaticParams() {
return paths.map((slug) => ({ slug }));
}

const PostPage = async ({ params: { slug } }: MetadataParams) => {
const PostPage = async ({ params }: MetadataParams) => {
const { slug } = await params;
const featuredPosts = getNewestPosts()
.filter((post) => post.slug !== slug)
.slice(0, 3);
const { transformedMdx, frontmatter } = await getPostBySlug(slug);
const { content, frontmatter } = getPostBySlug(slug);

const jsonLd: WithContext<Article> = {
"@context": "https://schema.org",
Expand All @@ -44,7 +46,7 @@ const PostPage = async ({ params: { slug } }: MetadataParams) => {

return (
<>
<Resource content={transformedMdx} metadata={frontmatter} />
<Resource content={content} metadata={frontmatter} />
<FeaturedPosts posts={featuredPosts} />
{/* Needed to add JSON-LD to the page */}
<script
Expand Down
14 changes: 4 additions & 10 deletions app/blog/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Blog } from "@/components/blog";
import { Category } from "@/types";
import { getMetadata } from "lib/metadata";
import { getPostsCategories } from "lib/posts";
import { getMetadata } from "@/lib/metadata";
import { getPostsCategories } from "@/lib/posts";

const description = "Discover my collection of articles, guides, and insights on various topics ✍️";

Expand All @@ -12,17 +11,12 @@ export const metadata = getMetadata({
canonical: "/blog",
});

const BlogPage = async ({ searchParams }: { searchParams: Promise<{ category?: Category }> }) => {
const BlogPage = () => {
const categories = getPostsCategories();
const activeCategory = (await searchParams).category;

return (
<>
<Blog
categories={categories}
description={description}
{...(activeCategory && { activeCategory })}
/>
<Blog categories={categories} description={description} />
</>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/contact/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Contact } from "@/components/contact";
import { Hero } from "@/components/contact/hero";
import { getMetadata } from "lib/metadata";
import { getMetadata } from "@/lib/metadata";

const description = "Do you want to cooperate? Ask for something? Or just chat? Let me know 💬";

Expand Down
5 changes: 3 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import { DEFAULT_METADATA, DEFAULT_VIEWPORT } from "@/lib/metadata";
import { Analytics } from "@/providers/analytics";
import { ThemeProvider } from "@/providers/theme";

import "../styles/code.css";
import "../styles/globals.css";
// eslint-disable-next-line import/order
import "../styles/code.css";

export const metadata = DEFAULT_METADATA;
export const viewport = DEFAULT_VIEWPORT;
Expand Down Expand Up @@ -69,7 +70,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
>
<Header />
<div className="container mx-auto h-[52px] sm:h-16 sm:border-x" />
<main className="divide-y sm:border-b">
<main className="divide-y sm:border-b" id="main">
{children}
<Newsletter />
</main>
Expand Down
100 changes: 100 additions & 0 deletions app/manifest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import type { MetadataRoute } from "next";

export default function manifest(): MetadataRoute.Manifest {
return {
name: "Bart Zagrodzki",
short_name: "zagrodzki.me",
description:
"I'm a software engineer building products to help people lead better lives 🎯 In love with creative solutions - constantly learning and discovering new stuff 📖",
background_color: "#F7F1F3",
theme_color: "#855B52",
start_url: "/?source=pwa",
display: "standalone",
icons: [
{
src: "/regular-android-icon-36x36.png",
sizes: "36x36",
type: "image/png",
purpose: "any",
},
{
src: "/regular-android-icon-48x48.png",
sizes: "48x48",
type: "image/png",
purpose: "any",
},
{
src: "/regular-android-icon-72x72.png",
sizes: "72x72",
type: "image/png",
purpose: "any",
},
{
src: "/regular-android-icon-96x96.png",
sizes: "96x96",
type: "image/png",
purpose: "any",
},
{
src: "/regular-android-icon-144x144.png",
sizes: "144x144",
type: "image/png",
purpose: "any",
},
{
src: "/regular-android-icon-192x192.png",
sizes: "192x192",
type: "image/png",
purpose: "any",
},
{
src: "/regular-android-icon-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any",
},
{
src: "/maskable-android-icon-36x36.png",
sizes: "36x36",
type: "image/png",
purpose: "maskable",
},
{
src: "/maskable-android-icon-48x48.png",
sizes: "48x48",
type: "image/png",
purpose: "maskable",
},
{
src: "/maskable-android-icon-72x72.png",
sizes: "72x72",
type: "image/png",
purpose: "maskable",
},
{
src: "/maskable-android-icon-96x96.png",
sizes: "96x96",
type: "image/png",
purpose: "maskable",
},
{
src: "/maskable-android-icon-144x144.png",
sizes: "144x144",
type: "image/png",
purpose: "maskable",
},
{
src: "/maskable-android-icon-192x192.png",
sizes: "192x192",
type: "image/png",
purpose: "maskable",
},
{
src: "/maskable-android-icon-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
};
}
9 changes: 5 additions & 4 deletions app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import Image from "next/image";

import { Section } from "@/components/common/sections/section";
import { ViewAnimation } from "@/providers/view-animation";
import PissedOffAvatar from "public/img/avatars/pissed-off.png";

import PissedOffAvatar from "../public/img/avatars/pissed-off.png";

const NotFoundPage = () => (
<Section className="flex flex-col items-center justify-center py-16 lg:py-24 px-8">
<Section className="flex flex-col items-center justify-center px-8 py-16 lg:py-24">
<ViewAnimation
initial={{ opacity: 0, translateY: -8 }}
whileInView={{ opacity: 1, translateY: 0 }}
Expand All @@ -18,14 +19,14 @@ const NotFoundPage = () => (
whileInView={{ opacity: 1, translateY: 0 }}
delay={0.2}
>
<h1 className="text-4xl sm:text-5xl lg:text-6xl font-bold text-destructive">404!</h1>
<h1 className="text-4xl font-bold text-destructive sm:text-5xl lg:text-6xl">404!</h1>
</ViewAnimation>
<ViewAnimation
initial={{ opacity: 0, translateY: -8 }}
whileInView={{ opacity: 1, translateY: 0 }}
delay={0.4}
>
<p className="text-lg text-muted-foreground mt-4 lg:mt-6 leading-tight text-center">
<p className="mt-4 text-center text-lg leading-tight text-muted-foreground lg:mt-6">
The page you are looking for does not exist.
</p>
</ViewAnimation>
Expand Down
6 changes: 3 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GitHubActivity } from "@/components/home/github-activity";
import { Hero } from "@/components/home/hero";
import { LatestRead } from "@/components/home/latest-read";
import { Spotify } from "@/components/home/spotify";
import { getNewestPosts } from "lib/posts";
import { getNewestPosts } from "@/lib/posts";

const Home = () => {
const [post] = getNewestPosts();
Expand All @@ -21,10 +21,10 @@ const Home = () => {
<FeaturedTweet />
<Feed />
<Section className="grid divide-y lg:grid-cols-2 lg:divide-x lg:divide-y-0">
<div className="px-6 py-4 lg:py-6 min-w-0">
<div className="min-w-0 px-6 py-4 lg:py-6">
<Spotify />
</div>
<div className="px-6 py-4 lg:py-6 min-w-0">
<div className="min-w-0 px-6 py-4 lg:py-6">
<LatestRead />
</div>
</Section>
Expand Down
13 changes: 13 additions & 0 deletions app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { HOST } from "@/utils/consts";

import type { MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: "*",
allow: "/",
},
sitemap: `${HOST}/sitemap.xml`,
};
}
Loading

0 comments on commit 562c55b

Please sign in to comment.