From e566ef6c3836d46641fd25f6431507a4591f4b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LUDWIG?= Date: Mon, 23 Oct 2023 23:11:59 +0200 Subject: [PATCH] chore: better Prettier config for easier reviews --- .devcontainer/compose.yaml | 10 +- .github/ISSUE_TEMPLATE/BUG.md | 8 +- .github/ISSUE_TEMPLATE/DOCUMENTATION.md | 8 +- .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md | 8 +- .github/ISSUE_TEMPLATE/IMPROVEMENT.md | 8 +- .github/ISSUE_TEMPLATE/QUESTION.md | 8 +- .github/workflows/build.yml | 22 +- .github/workflows/lint.yml | 40 +- .github/workflows/release.yml | 26 +- .github/workflows/test.yml | 50 +- .gitpod.yml | 10 +- .prettierrc.json | 5 +- CONTRIBUTING.md | 2 +- Dockerfile | 6 +- app/blog/[slug]/loading.tsx | 4 +- app/blog/[slug]/page.tsx | 18 +- app/blog/loading.tsx | 4 +- app/blog/page.tsx | 28 +- app/error.tsx | 16 +- app/globals.css | 8 +- app/layout.tsx | 50 +- app/loading.tsx | 4 +- app/not-found.tsx | 24 +- app/page.tsx | 36 +- blog/BlogPost.tsx | 20 +- blog/BlogPostComments.tsx | 30 +- blog/BlogPostContent.tsx | 76 +- blog/BlogPosts.tsx | 24 +- blog/blog.ts | 22 +- blog/posts/clean-code.md | 26 +- blog/posts/git-ultimate-guide.md | 6 +- blog/posts/hello-world.md | 6 +- blog/posts/mistakes-as-junior-developer.md | 6 +- blog/posts/programming-challenges.md | 6 +- blog/posts/thream-v1-0-0.md | 6 +- blog/remarkSyntaxHighlightingPlugin.ts | 14 +- components/Footer/FooterText.tsx | 12 +- components/Footer/FooterVersion.tsx | 14 +- components/Footer/index.tsx | 8 +- components/Header/Locales/Arrow.tsx | 14 +- components/Header/Locales/LocaleFlag.tsx | 8 +- components/Header/Locales/index.tsx | 38 +- components/Header/SwitchTheme.tsx | 62 +- components/Header/index.tsx | 34 +- components/Interests/InterestParagraph.tsx | 8 +- .../Interests/InterestsList/InterestItem.tsx | 8 +- components/Interests/InterestsList/index.tsx | 16 +- components/Interests/index.tsx | 12 +- components/OpenSource/Repository.tsx | 16 +- components/OpenSource/index.tsx | 36 +- components/Portfolio/PortfolioItem.tsx | 22 +- components/Portfolio/index.tsx | 10 +- .../Profile/ProfileDescriptionBottom.tsx | 12 +- components/Profile/ProfileInfo.tsx | 10 +- .../Profile/ProfileList/ProfileItem.tsx | 8 +- components/Profile/ProfileList/index.tsx | 32 +- components/Profile/ProfileLogo.tsx | 8 +- .../SocialMediaIcons/EmailIcon.tsx | 6 +- .../SocialMediaIcons/GitHubIcon.tsx | 6 +- .../SocialMediaIcons/GitLabIcon.tsx | 6 +- .../SocialMediaList/SocialMediaIcons/Icon.tsx | 10 +- .../SocialMediaIcons/NPMIcon.tsx | 4 +- .../SocialMediaIcons/TwitchIcon.tsx | 6 +- .../SocialMediaIcons/TwitterIcon.tsx | 6 +- .../SocialMediaIcons/YouTubeIcon.tsx | 6 +- .../SocialMediaList/SocialMediaItem.tsx | 8 +- components/Profile/SocialMediaList/index.tsx | 38 +- components/Profile/index.tsx | 12 +- components/Skills/Skill.tsx | 24 +- components/Skills/SkillsSection.tsx | 14 +- components/Skills/index.tsx | 48 +- components/Skills/skills.ts | 124 +- components/design/Loader.tsx | 14 +- components/design/RevealFade.tsx | 14 +- components/design/Section/SectionHeading.tsx | 4 +- components/design/Section/index.tsx | 18 +- components/design/ShadowContainer.tsx | 8 +- compose.yaml | 10 +- curriculum-vitae/build.js | 18 +- curriculum-vitae/package-lock.json | 51 +- curriculum-vitae/package.json | 4 +- curriculum-vitae/scripts/main.js | 4 +- curriculum-vitae/styles/global.css | 4 +- curriculum-vitae/vite.config.ts | 34 +- cypress.config.ts | 14 +- cypress/component/utils/getAge.cy.ts | 16 +- cypress/e2e/common/Header.cy.ts | 82 +- cypress/e2e/pages/404.cy.ts | 8 +- cypress/e2e/pages/blog/[slug].cy.ts | 16 +- cypress/e2e/pages/blog/index.cy.ts | 26 +- cypress/e2e/pages/index.cy.ts | 14 +- cypress/support/component.ts | 8 +- i18n/i18n.client.ts | 10 +- i18n/i18n.server.ts | 20 +- i18n/i18n.ts | 30 +- middleware.ts | 38 +- next.config.js | 8 +- package-lock.json | 2244 +++++++++-------- package.json | 54 +- postcss.config.js | 4 +- tailwind.config.js | 54 +- theme/theme.client.ts | 8 +- theme/theme.server.ts | 16 +- utils/constants.ts | 8 +- utils/getAge.ts | 6 +- 105 files changed, 2138 insertions(+), 2080 deletions(-) diff --git a/.devcontainer/compose.yaml b/.devcontainer/compose.yaml index 727b3a2..7ec0792 100644 --- a/.devcontainer/compose.yaml +++ b/.devcontainer/compose.yaml @@ -1,9 +1,9 @@ services: workspace: build: - context: './' - dockerfile: './Dockerfile' + context: "./" + dockerfile: "./Dockerfile" volumes: - - '..:/workspace:cached' - command: 'sleep infinity' - network_mode: 'host' + - "..:/workspace:cached" + command: "sleep infinity" + network_mode: "host" diff --git a/.github/ISSUE_TEMPLATE/BUG.md b/.github/ISSUE_TEMPLATE/BUG.md index e1fc7e7..d47b126 100644 --- a/.github/ISSUE_TEMPLATE/BUG.md +++ b/.github/ISSUE_TEMPLATE/BUG.md @@ -1,8 +1,8 @@ --- -name: '๐Ÿ› Bug Report' -about: 'Report an unexpected problem or unintended behavior.' -title: '[Bug]' -labels: 'bug' +name: "๐Ÿ› Bug Report" +about: "Report an unexpected problem or unintended behavior." +title: "[Bug]" +labels: "bug" --- diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md index 3307418..dc9a49c 100644 --- a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md @@ -1,8 +1,8 @@ --- -name: 'โœจ Feature Request' -about: 'Suggest a new feature idea.' -title: '[Feature]' -labels: 'feature request' +name: "โœจ Feature Request" +about: "Suggest a new feature idea." +title: "[Feature]" +labels: "feature request" --- diff --git a/.github/ISSUE_TEMPLATE/IMPROVEMENT.md b/.github/ISSUE_TEMPLATE/IMPROVEMENT.md index b5bdbb7..e50e289 100644 --- a/.github/ISSUE_TEMPLATE/IMPROVEMENT.md +++ b/.github/ISSUE_TEMPLATE/IMPROVEMENT.md @@ -1,8 +1,8 @@ --- -name: '๐Ÿ”ง Improvement' -about: 'Improve structure/format/performance/refactor/tests of the code.' -title: '[Improvement]' -labels: 'improvement' +name: "๐Ÿ”ง Improvement" +about: "Improve structure/format/performance/refactor/tests of the code." +title: "[Improvement]" +labels: "improvement" --- diff --git a/.github/ISSUE_TEMPLATE/QUESTION.md b/.github/ISSUE_TEMPLATE/QUESTION.md index c18eaa3..df6acdc 100644 --- a/.github/ISSUE_TEMPLATE/QUESTION.md +++ b/.github/ISSUE_TEMPLATE/QUESTION.md @@ -1,8 +1,8 @@ --- -name: '๐Ÿ™‹ Question' -about: 'Further information is requested.' -title: '[Question]' -labels: 'question' +name: "๐Ÿ™‹ Question" +about: "Further information is requested." +title: "[Question]" +labels: "question" --- ### Question diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 044f75d..855162b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: 'Build' +name: "Build" on: push: @@ -8,18 +8,18 @@ on: jobs: build: - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" steps: - - uses: 'actions/checkout@v4.0.0' + - uses: "actions/checkout@v4.0.0" - - name: 'Setup Node.js' - uses: 'actions/setup-node@v3.8.1' + - name: "Setup Node.js" + uses: "actions/setup-node@v3.8.1" with: - node-version: '20.x' - cache: 'npm' + node-version: "20.x" + cache: "npm" - - name: 'Install dependencies' - run: 'npm clean-install' + - name: "Install dependencies" + run: "npm clean-install" - - name: 'Build' - run: 'npm run build' + - name: "Build" + run: "npm run build" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ae111ef..9a03df6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: 'Lint' +name: "Lint" on: push: @@ -8,35 +8,35 @@ on: jobs: lint: - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" steps: - - uses: 'actions/checkout@v4.0.0' + - uses: "actions/checkout@v4.0.0" - - name: 'Setup Node.js' - uses: 'actions/setup-node@v3.8.1' + - name: "Setup Node.js" + uses: "actions/setup-node@v3.8.1" with: - node-version: '20.x' - cache: 'npm' + node-version: "20.x" + cache: "npm" - - name: 'Install dependencies' - run: 'npm clean-install' + - name: "Install dependencies" + run: "npm clean-install" - - name: 'lint:commit' + - name: "lint:commit" run: 'npm run lint:commit -- --to "${{ github.sha }}"' - - name: 'lint:editorconfig' - run: 'npm run lint:editorconfig' + - name: "lint:editorconfig" + run: "npm run lint:editorconfig" - - name: 'lint:markdown' - run: 'npm run lint:markdown' + - name: "lint:markdown" + run: "npm run lint:markdown" - - name: 'lint:eslint' - run: 'npm run lint:eslint' + - name: "lint:eslint" + run: "npm run lint:eslint" - - name: 'lint:prettier' - run: 'npm run lint:prettier' + - name: "lint:prettier" + run: "npm run lint:prettier" - - name: 'lint:dotenv' - uses: 'dotenv-linter/action-dotenv-linter@v2.18.0' + - name: "lint:dotenv" + uses: "dotenv-linter/action-dotenv-linter@v2.18.0" with: github_token: ${{ secrets.github_token }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bfa4537..fe1aa96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: 'Release' +name: "Release" on: push: @@ -6,31 +6,31 @@ on: jobs: release: - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" steps: - - uses: 'actions/checkout@v4.0.0' + - uses: "actions/checkout@v4.0.0" with: fetch-depth: 0 persist-credentials: false - - name: 'Import GPG key' - uses: 'crazy-max/ghaction-import-gpg@v6.0.0' + - name: "Import GPG key" + uses: "crazy-max/ghaction-import-gpg@v6.0.0" with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} git_user_signingkey: true git_commit_gpgsign: true - - name: 'Setup Node.js' - uses: 'actions/setup-node@v3.8.1' + - name: "Setup Node.js" + uses: "actions/setup-node@v3.8.1" with: - node-version: '20.x' - cache: 'npm' + node-version: "20.x" + cache: "npm" - - name: 'Install dependencies' - run: 'npm clean-install' + - name: "Install dependencies" + run: "npm clean-install" - - name: 'Release' - run: 'npm run release' + - name: "Release" + run: "npm run release" env: GH_TOKEN: ${{ secrets.GH_TOKEN }} GIT_COMMITTER_NAME: ${{ secrets.GIT_NAME }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 82d54c7..7635655 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: 'Test' +name: "Test" on: push: @@ -8,41 +8,41 @@ on: jobs: test-unit: - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" steps: - - uses: 'actions/checkout@v4.0.0' + - uses: "actions/checkout@v4.0.0" - - name: 'Setup Node.js' - uses: 'actions/setup-node@v3.8.1' + - name: "Setup Node.js" + uses: "actions/setup-node@v3.8.1" with: - node-version: '20.x' - cache: 'npm' + node-version: "20.x" + cache: "npm" - - name: 'Install dependencies' - run: 'npm clean-install' + - name: "Install dependencies" + run: "npm clean-install" - - name: 'Unit Test' - run: 'npm run test:unit' + - name: "Unit Test" + run: "npm run test:unit" test-e2e: - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" steps: - - uses: 'actions/checkout@v4.0.0' + - uses: "actions/checkout@v4.0.0" - - name: 'Setup Node.js' - uses: 'actions/setup-node@v3.8.1' + - name: "Setup Node.js" + uses: "actions/setup-node@v3.8.1" with: - node-version: '20.x' - cache: 'npm' + node-version: "20.x" + cache: "npm" - - name: 'Install dependencies' - run: 'npm clean-install' + - name: "Install dependencies" + run: "npm clean-install" - - name: 'Build' - run: 'npm run build' + - name: "Build" + run: "npm run build" - - name: 'html-w3c-validator' - run: 'npm run test:html-w3c-validator' + - name: "html-w3c-validator" + run: "npm run test:html-w3c-validator" - - name: 'End To End (e2e) Test' - run: 'npm run test:e2e' + - name: "End To End (e2e) Test" + run: "npm run test:e2e" diff --git a/.gitpod.yml b/.gitpod.yml index 3bb54ce..dbdd2de 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,13 +1,13 @@ -image: 'gitpod/workspace-full' +image: "gitpod/workspace-full" tasks: - - before: 'cp .env.example .env' - init: 'npm clean-install' - command: 'npm run dev' + - before: "cp .env.example .env" + init: "npm clean-install" + command: "npm run dev" ports: - port: 3000 - onOpen: 'open-preview' + onOpen: "open-preview" github: prebuilds: diff --git a/.prettierrc.json b/.prettierrc.json index 83ef1ce..cce9d3c 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,6 +1,3 @@ { - "singleQuote": true, - "jsxSingleQuote": true, - "semi": false, - "trailingComma": "none" + "semi": false } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1655527..95a4626 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ The commit message guidelines adheres to [Conventional Commits](https://www.conv ### Prerequisites - [Node.js](https://nodejs.org/) >= 20.0.0 -- [npm](https://www.npmjs.com/) >= 9.0.0 +- [npm](https://www.npmjs.com/) >= 10.0.0 ### Installation diff --git a/Dockerfile b/Dockerfile index a2645b9..47034c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ -FROM node:20.6.1 AS builder-dependencies +FROM node:20.9.0 AS builder-dependencies WORKDIR /usr/src/application COPY ./package*.json ./ RUN npm clean-install -FROM node:20.6.1 AS builder +FROM node:20.9.0 AS builder WORKDIR /usr/src/application COPY --from=builder-dependencies /usr/src/application/node_modules ./node_modules COPY ./ ./ RUN npm run build -FROM gcr.io/distroless/nodejs20-debian11:latest AS runner +FROM gcr.io/distroless/nodejs20-debian12:latest AS runner WORKDIR /usr/src/application ENV NODE_ENV=production ENV HOSTNAME=0.0.0.0 diff --git a/app/blog/[slug]/loading.tsx b/app/blog/[slug]/loading.tsx index 663fff6..513703e 100644 --- a/app/blog/[slug]/loading.tsx +++ b/app/blog/[slug]/loading.tsx @@ -1,8 +1,8 @@ -import { Loader } from '@/components/design/Loader' +import { Loader } from "@/components/design/Loader" const Loading = (): JSX.Element => { return ( -
+
) diff --git a/app/blog/[slug]/page.tsx b/app/blog/[slug]/page.tsx index bd4d133..456802c 100644 --- a/app/blog/[slug]/page.tsx +++ b/app/blog/[slug]/page.tsx @@ -1,10 +1,10 @@ -import type { Metadata } from 'next' -import { notFound } from 'next/navigation' +import type { Metadata } from "next" +import { notFound } from "next/navigation" -import 'katex/dist/katex.min.css' +import "katex/dist/katex.min.css" -import { getBlogPostBySlug } from '@/blog/blog' -import { BlogPost } from '@/blog/BlogPost' +import { getBlogPostBySlug } from "@/blog/blog" +import { BlogPost } from "@/blog/BlogPost" interface BlogPostPageProps { params: { @@ -13,7 +13,7 @@ interface BlogPostPageProps { } export const generateMetadata = async ( - props: BlogPostPageProps + props: BlogPostPageProps, ): Promise => { const blogPost = await getBlogPostBySlug(props.params.slug) if (blogPost == null) { @@ -26,12 +26,12 @@ export const generateMetadata = async ( description, openGraph: { title, - description + description, }, twitter: { title, - description - } + description, + }, } } diff --git a/app/blog/loading.tsx b/app/blog/loading.tsx index 663fff6..513703e 100644 --- a/app/blog/loading.tsx +++ b/app/blog/loading.tsx @@ -1,8 +1,8 @@ -import { Loader } from '@/components/design/Loader' +import { Loader } from "@/components/design/Loader" const Loading = (): JSX.Element => { return ( -
+
) diff --git a/app/blog/page.tsx b/app/blog/page.tsx index b503ef0..4513ef8 100644 --- a/app/blog/page.tsx +++ b/app/blog/page.tsx @@ -1,36 +1,36 @@ -import { Suspense } from 'react' -import type { Metadata } from 'next' +import { Suspense } from "react" +import type { Metadata } from "next" -import { BlogPosts } from '@/blog/BlogPosts' -import { Loader } from '@/components/design/Loader' +import { BlogPosts } from "@/blog/BlogPosts" +import { Loader } from "@/components/design/Loader" -const title = 'Blog | Thรฉo LUDWIG' +const title = "Blog | Thรฉo LUDWIG" const description = - 'The latest news about my journey of learning computer science.' + "The latest news about my journey of learning computer science." export const metadata: Metadata = { title, description, openGraph: { title, - description + description, }, twitter: { title, - description - } + description, + }, } const BlogPage = async (): Promise => { return ( -
-
-

Blog

-

+

+
+

Blog

+

{description}

- }> + }>
diff --git a/app/error.tsx b/app/error.tsx index 4520702..227caed 100644 --- a/app/error.tsx +++ b/app/error.tsx @@ -1,6 +1,6 @@ -'use client' +"use client" -import { useEffect } from 'react' +import { useEffect } from "react" export interface ErrorHandlingProps { error: Error @@ -14,17 +14,17 @@ const ErrorHandling = (props: ErrorHandlingProps): JSX.Element => { }, [error]) return ( -
-

- Error{' '} +
+

+ Error{" "} 500

-

Server error

+

Server error

) } diff --git a/app/globals.css b/app/globals.css index c7c6ba8..1bb9b6a 100644 --- a/app/globals.css +++ b/app/globals.css @@ -16,7 +16,7 @@ } .prose [id]::before { - content: ''; + content: ""; display: block; height: 90px; margin-top: -90px; @@ -39,9 +39,9 @@ .prose code { color: #ce9178; } -.prose :where(code):not(:where([class~='not-prose'] *))::before, -.prose :where(code):not(:where([class~='not-prose'] *))::after { - content: ''; +.prose :where(code):not(:where([class~="not-prose"] *))::before, +.prose :where(code):not(:where([class~="not-prose"] *))::after { + content: ""; } .shiki { white-space: pre-wrap !important; diff --git a/app/layout.tsx b/app/layout.tsx index 118af0a..7006f1b 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,21 +1,21 @@ -import type { Metadata } from 'next' -import classNames from 'clsx' +import type { Metadata } from "next" +import classNames from "clsx" -import '@fontsource/montserrat/400.css' -import '@fontsource/montserrat/600.css' -import './globals.css' +import "@fontsource/montserrat/400.css" +import "@fontsource/montserrat/600.css" +import "./globals.css" -import { Header } from '@/components/Header' -import { Footer } from '@/components/Footer' -import { getI18n } from '@/i18n/i18n.server' -import { getTheme } from '@/theme/theme.server' +import { Header } from "@/components/Header" +import { Footer } from "@/components/Footer" +import { getI18n } from "@/i18n/i18n.server" +import { getTheme } from "@/theme/theme.server" -const title = 'Thรฉo LUDWIG' +const title = "Thรฉo LUDWIG" const description = - 'Thรฉo LUDWIG - Developer Full Stack โ€ข Open-Source enthusiast' -const image = '/images/icon-96x96.png' -const url = new URL('https://theoludwig.fr') -const locale = 'fr-FR, en-US' + "Thรฉo LUDWIG - Developer Full Stack โ€ข Open-Source enthusiast" +const image = "/images/icon-96x96.png" +const url = new URL("https://theoludwig.fr") +const locale = "fr-FR, en-US" export const metadata: Metadata = { title, @@ -30,21 +30,21 @@ export const metadata: Metadata = { { url: image, width: 96, - height: 96 - } + height: 96, + }, ], locale, - type: 'website' + type: "website", }, icons: { - icon: '/images/icon-96x96.png' + icon: "/images/icon-96x96.png", }, twitter: { - card: 'summary', + card: "summary", title, description, - images: [image] - } + images: [image], + }, } interface RootLayoutProps { @@ -61,14 +61,14 @@ const RootLayout = (props: RootLayoutProps): JSX.Element => { - +
{children}