From d0cde4538c0624a730ac9a5d79519273b0457e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LUDWIG?= Date: Tue, 17 Feb 2026 01:23:03 +0100 Subject: [PATCH] chore: migrate from ESLint/Prettier to Oxc --- .github/workflows/chromatic.yml | 10 +- .github/workflows/ci.yml | 13 +- .oxfmtrc.json | 9 + .oxlintrc.json | 16 + .prettierrc.json | 13 - .vscode/extensions.json | 3 +- .vscode/settings.json | 28 +- CONTRIBUTING.md | 9 +- README.md | 24 +- apps/storybook/.storybook/main.ts | 6 +- apps/storybook/eslint.config.js | 14 - apps/storybook/http-server.ts | 4 +- apps/storybook/package.json | 17 +- apps/storybook/stories/Colors.mdx | 7 +- apps/website/Dockerfile | 6 +- .../app/[locale]/(main)/blog/[slug]/page.tsx | 8 +- .../website/app/[locale]/(main)/blog/page.tsx | 9 +- .../app/[locale]/curriculum-vitae/layout.tsx | 4 +- apps/website/app/[locale]/layout.tsx | 15 +- apps/website/eslint.config.js | 14 - apps/website/next.config.ts | 3 - apps/website/package.json | 18 +- configs/config-eslint/eslint.config.js | 75 - configs/config-eslint/index.d.ts | 5 - configs/config-eslint/package.json | 27 - configs/config-tailwind/eslint.config.js | 14 - configs/config-tailwind/package.json | 7 +- configs/config-tailwind/styles.css | 10 +- package.json | 31 +- packages/blog/eslint.config.js | 14 - packages/blog/package.json | 32 +- packages/blog/posts/clean-code.md | 5 +- packages/blog/src/BlogPost.ts | 3 +- packages/blog/src/BlogPostContent.tsx | 23 +- packages/blog/src/BlogPostUI.tsx | 4 +- packages/blog/src/BlogPosts.tsx | 4 +- packages/blog/src/blog.ts | 13 +- packages/blog/tsconfig.json | 6 +- packages/i18n/eslint.config.js | 14 - packages/i18n/package.json | 6 +- packages/i18n/src/request.ts | 13 +- packages/i18n/src/routing.ts | 10 +- .../curriculum-vitae.fr-FR.legacy.jsonc | 8 +- packages/ui/eslint.config.js | 14 - packages/ui/package.json | 15 +- .../CurriculumVitaeEducation.tsx | 67 +- .../CurriculumVitaeInterests.tsx | 16 +- .../CurriculumVitaeProfile.tsx | 8 +- .../CurriculumVitaeSection.tsx | 4 +- .../CurriculumVitae/CurriculumVitaeSkills.tsx | 15 +- .../ui/src/Design/Button/Button.stories.tsx | 5 +- packages/ui/src/Design/Button/Button.tsx | 78 +- packages/ui/src/Design/Link/Link.tsx | 8 +- packages/ui/src/Design/Spinner/Spinner.tsx | 2 +- .../Design/Typography/Typography.stories.tsx | 7 +- .../ui/src/Design/Typography/Typography.tsx | 42 +- .../Errors/ErrorNotFound/ErrorNotFound.tsx | 3 +- .../ui/src/Home/About/AboutDescription.tsx | 2 +- .../ui/src/Home/About/AboutList/AboutItem.tsx | 6 +- .../ui/src/Home/About/AboutList/AboutList.tsx | 10 +- packages/ui/src/Home/About/AboutLogo.tsx | 8 +- .../SocialMediaList/SocialMediaIcons/Icon.tsx | 5 +- .../About/SocialMediaList/SocialMediaList.tsx | 15 +- .../ui/src/Home/Interests/InterestItem.tsx | 6 +- packages/ui/src/Home/Interests/Interests.tsx | 16 +- .../ui/src/Home/OpenSource/OpenSource.tsx | 10 +- .../ui/src/Home/OpenSource/Repository.tsx | 4 +- .../ui/src/Home/Portfolio/PortfolioItem.tsx | 5 +- packages/ui/src/Layout/Footer/Footer.tsx | 11 +- packages/ui/src/Layout/Header/Header.tsx | 6 +- .../ui/src/Layout/Header/Locales/Arrow.tsx | 8 +- .../ui/src/Layout/Header/Locales/Locales.tsx | 14 +- packages/ui/src/Layout/Header/SwitchTheme.tsx | 14 +- packages/ui/src/Layout/Section/RevealFade.tsx | 3 +- packages/ui/src/Layout/Section/Section.tsx | 13 +- packages/utils/eslint.config.js | 14 - packages/utils/package.json | 6 +- packages/utils/src/constants.ts | 3 +- packages/utils/src/objects.ts | 5 +- packages/utils/src/types.ts | 9 +- pnpm-lock.yaml | 5770 +++++++---------- pnpm-workspace.yaml | 74 +- turbo.json | 16 +- 83 files changed, 2569 insertions(+), 4342 deletions(-) create mode 100644 .oxfmtrc.json create mode 100644 .oxlintrc.json delete mode 100755 .prettierrc.json delete mode 100644 apps/storybook/eslint.config.js delete mode 100644 apps/website/eslint.config.js delete mode 100644 configs/config-eslint/eslint.config.js delete mode 100644 configs/config-eslint/index.d.ts delete mode 100644 configs/config-eslint/package.json delete mode 100644 configs/config-tailwind/eslint.config.js delete mode 100644 packages/blog/eslint.config.js delete mode 100644 packages/i18n/eslint.config.js delete mode 100644 packages/ui/eslint.config.js delete mode 100644 packages/utils/eslint.config.js diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index 9c9347c..fd777c3 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -18,23 +18,25 @@ jobs: NEXT_TELEMETRY_DISABLED: "1" STORYBOOK_DISABLE_TELEMETRY: "1" steps: - - uses: "actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8" # v6.0.1 + - uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2 with: fetch-depth: 0 - uses: "pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061" # v4.2.0 + - uses: "pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061" # v4.2.0 + - name: "Setup Node.js" - uses: "actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f" # v6.1.0 + uses: "actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238" # v6.2.0 with: - node-version: "24.11.1" + node-version: "24.13.1" cache: "pnpm" - name: "Install dependencies" run: "pnpm install --frozen-lockfile" - name: "Run Chromatic" - uses: "chromaui/action@ac86f2ff0a458ffbce7b40698abd44c0fa34d4b6" # latest + uses: "chromaui/action@07791f8243f4cb2698bf4d00426baf4b2d1cb7e0" # latest with: projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} workingDir: "apps/storybook" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9277957..3994574 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,14 +18,14 @@ jobs: NEXT_TELEMETRY_DISABLED: "1" STORYBOOK_DISABLE_TELEMETRY: "1" steps: - - uses: "actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8" # v6.0.1 + - uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2 - uses: "pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061" # v4.2.0 - name: "Setup Node.js" - uses: "actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f" # v6.1.0 + uses: "actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238" # v6.2.0 with: - node-version: "24.11.1" + node-version: "24.13.1" cache: "pnpm" - name: "Install dependencies" @@ -36,8 +36,9 @@ jobs: - run: "node --run lint:editorconfig" - run: "node --run lint:markdown" - - run: "node --run lint:typescript" - - run: "node --run lint:eslint" - - run: "node --run lint:prettier" + - run: "node --run lint:turbo" + # - run: "node --run lint:typescript" # already covered by oxlint + - run: "node --run lint:oxlint" + - run: "node --run lint:oxfmt" - run: "node --run test" - run: "node --run build" diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 0000000..ca5caa2 --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,9 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "ignorePatterns": ["pnpm-lock.yaml"], + "semi": false, + "experimentalTailwindcss": { + "stylesheet": "./configs/config-tailwind/styles.css", + "functions": ["classNames"] + } +} diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000..27dc4c1 --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,16 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "extends": ["node_modules/eslint-config-conventions/.oxlintrc.json"], + "rules": { + "import-x/extensions": [ + "error", + "ignorePackages", + { + "ts": "always", + "tsx": "always", + "js": "never", + "jsx": "never" + } + ] + } +} diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100755 index 30351be..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "semi": false, - "plugins": ["prettier-plugin-tailwindcss"], - "tailwindFunctions": ["classNames", "cva"], - "overrides": [ - { - "files": "pnpm-lock.yaml", - "options": { - "rangeEnd": 0 - } - } - ] -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 30506d9..8e1ad0f 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,7 @@ { "recommendations": [ "editorconfig.editorconfig", - "prettier.prettier-vscode", - "dbaeumer.vscode-eslint", + "oxc.oxc-vscode", "davidanson.vscode-markdownlint", "bradlc.vscode-tailwindcss", "antfu.pnpm-catalog-lens", diff --git a/.vscode/settings.json b/.vscode/settings.json index 02bc27a..965f57b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,31 +2,29 @@ "typescript.tsdk": "node_modules/typescript/lib", "editor.bracketPairColorization.enabled": true, "editor.wordWrap": "on", - "prettier.configPath": ".prettierrc.json", - "editor.defaultFormatter": "prettier.prettier-vscode", - "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.fixAll": "explicit", + "source.fixAll": "never", "source.organizeImports": "never" }, - "eslint.workingDirectories": [ - { - "mode": "auto" - } - ], - "files.associations": { - "*.css": "tailwindcss" - }, + "oxc.enable": true, + "oxc.typeAware": true, + "oxc.unusedDisableDirectives": "deny", + "editor.defaultFormatter": "oxc.oxc-vscode", + "editor.formatOnSave": true, + "typescript.experimental.useTsgo": false, "editor.quickSuggestions": { "strings": "on" }, - "tailwindCSS.classFunctions": ["classNames", "cva"], + "files.associations": { + "*.css": "tailwindcss" + }, + "tailwindCSS.classFunctions": ["classNames"], "tailwindCSS.experimental.configFile": "./configs/config-tailwind/styles.css", "i18n-ally.localesPaths": ["./packages/i18n/src/translations/"], "i18n-ally.keystyle": "nested", "i18n-ally.sortKeys": false, - "i18n-ally.sourceLanguage": "en-US", - "i18n-ally.displayLanguage": "en-US", + "i18n-ally.sourceLanguage": "fr-FR", + "i18n-ally.displayLanguage": "fr-FR", "i18n-ally.enabledFrameworks": ["next-intl", "general"], "i18n-ally.extract.autoDetect": true } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ebe9101..7a67fc7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,7 @@ The commit message guidelines adheres to [Conventional Commits](https://www.conv ### Prerequisites - [Node.js](https://nodejs.org/) >= v24.0.0 [(`nvm install 24`)](https://nvm.sh) -- [pnpm](https://pnpm.io/) v10.25.0 [(`npm install --global corepack@0.34.5 && corepack enable`)](https://github.com/nodejs/corepack) +- [pnpm](https://pnpm.io/) [(`npm install --global corepack@0.34.6 && corepack enable`)](https://github.com/nodejs/corepack) - [Docker](https://www.docker.com/) ### Installation @@ -60,9 +60,10 @@ node --run dev # Lint node --run lint:editorconfig node --run lint:markdown -node --run lint:typescript -node --run lint:eslint -node --run lint:prettier +node --run lint:turbo +# node --run lint:typescript # already covered by oxlint +node --run lint:oxlint +node --run lint:oxfmt # Tests node --run test diff --git a/README.md b/README.md index 8a28cad..3c3d7b3 100644 --- a/README.md +++ b/README.md @@ -35,29 +35,9 @@ "tRPC/oRPC", "PostgreSQL" ], - "sys-admin": [ - "Docker", - "Proxmox", - "Caddy", - "GitHub Actions", - "GitLab CI/CD" - ], - "software-tools": [ - "GNU/Linux", - "Arch Linux", - "Visual Studio Code", - "Git" - ], + "sys-admin": ["Docker", "Proxmox", "Caddy", "GitHub Actions", "GitLab CI/CD"], + "software-tools": ["GNU/Linux", "Arch Linux", "Visual Studio Code", "Git"], "systems-programming": ["C/C++", "Rust", "Go"] } } ``` - -
- -## Statistics - -

- Théo LUDWIG's GitHub Stats - Théo LUDWIG's Programming Languages -

diff --git a/apps/storybook/.storybook/main.ts b/apps/storybook/.storybook/main.ts index 7686478..010d589 100644 --- a/apps/storybook/.storybook/main.ts +++ b/apps/storybook/.storybook/main.ts @@ -12,11 +12,7 @@ const config: StorybookConfig = { "../../../packages/blog/src/**/*.stories.tsx", "../stories/*.mdx", ], - addons: [ - "@chromatic-com/storybook", - "@storybook/addon-docs", - "@storybook/addon-a11y", - ], + addons: ["@chromatic-com/storybook", "@storybook/addon-docs", "@storybook/addon-a11y"], framework: { name: "@storybook/nextjs", options: {}, diff --git a/apps/storybook/eslint.config.js b/apps/storybook/eslint.config.js deleted file mode 100644 index 1d6fe38..0000000 --- a/apps/storybook/eslint.config.js +++ /dev/null @@ -1,14 +0,0 @@ -import typescriptESLint from "typescript-eslint" -import { defineConfig } from "eslint/config" -import config from "@repo/config-eslint" - -export default defineConfig(...config, { - files: ["**/*.ts", "**/*.tsx"], - languageOptions: { - parser: typescriptESLint.parser, - parserOptions: { - projectService: true, - tsconfigRootDir: import.meta.dirname, - }, - }, -}) diff --git a/apps/storybook/http-server.ts b/apps/storybook/http-server.ts index d744a92..f53aa68 100644 --- a/apps/storybook/http-server.ts +++ b/apps/storybook/http-server.ts @@ -76,9 +76,7 @@ server.listen( port, }, () => { - console.log( - `HTTP Server is listening at ${util.styleText("cyan", serverURL)}`, - ) + console.log(`HTTP Server is listening at ${util.styleText("cyan", serverURL)}`) console.log(`Serving files from: \`${basePath}\``) }, ) diff --git a/apps/storybook/package.json b/apps/storybook/package.json index d5074d6..4e4b6f2 100644 --- a/apps/storybook/package.json +++ b/apps/storybook/package.json @@ -13,39 +13,36 @@ "chromatic": "chromatic" }, "dependencies": { + "@repo/blog": "workspace:*", "@repo/config-tailwind": "workspace:*", "@repo/i18n": "workspace:*", "@repo/ui": "workspace:*", "@repo/utils": "workspace:*", - "@repo/blog": "workspace:*", + "mime": "catalog:", "next": "catalog:", "next-intl": "catalog:", "next-themes": "catalog:", "react": "catalog:", - "react-dom": "catalog:", - "mime": "catalog:" + "react-dom": "catalog:" }, "devDependencies": { - "@repo/config-eslint": "workspace:*", - "@repo/config-typescript": "workspace:*", "@chromatic-com/storybook": "catalog:", "@playwright/test": "catalog:", - "@storybook/addon-docs": "catalog:", + "@repo/config-typescript": "workspace:*", "@storybook/addon-a11y": "catalog:", + "@storybook/addon-docs": "catalog:", "@storybook/addon-themes": "catalog:", "@storybook/nextjs": "catalog:", "@storybook/test-runner": "catalog:", + "@tailwindcss/postcss": "catalog:", "@types/node": "catalog:", "@types/react": "catalog:", "@types/react-dom": "catalog:", "chromatic": "catalog:", - "eslint": "catalog:", + "postcss": "catalog:", "start-server-and-test": "catalog:", "storybook": "catalog:", - "postcss": "catalog:", "tailwindcss": "catalog:", - "@tailwindcss/postcss": "catalog:", - "typescript-eslint": "catalog:", "typescript": "catalog:" } } diff --git a/apps/storybook/stories/Colors.mdx b/apps/storybook/stories/Colors.mdx index 57daf38..3105c32 100644 --- a/apps/storybook/stories/Colors.mdx +++ b/apps/storybook/stories/Colors.mdx @@ -1,9 +1,4 @@ -import { - Meta, - Title, - ColorPalette, - ColorItem, -} from "@storybook/addon-docs/blocks" +import { Meta, Title, ColorPalette, ColorItem } from "@storybook/addon-docs/blocks" import tailwindConfig from "@repo/config-tailwind" diff --git a/apps/website/Dockerfile b/apps/website/Dockerfile index 2a89b0a..5495ffd 100644 --- a/apps/website/Dockerfile +++ b/apps/website/Dockerfile @@ -1,7 +1,7 @@ -FROM node:24.11.1-slim@sha256:0afb7822fac7bf9d7c1bf3b6e6c496dee6b2b64d8dfa365501a3c68e8eba94b2 AS node-pnpm +FROM node:24.13.1-slim@sha256:a81a03dd965b4052269a57fac857004022b522a4bf06e7a739e25e18bce45af2 AS node-pnpm ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" -RUN npm install --global corepack@0.34.5 && corepack enable +RUN npm install --global corepack@0.34.6 && corepack enable ENV TURBO_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1 ENV DO_NOT_TRACK=1 @@ -9,7 +9,7 @@ WORKDIR /usr/src/app FROM node-pnpm AS builder COPY ./ ./ -RUN pnpm install --global turbo@2.6.3 +RUN pnpm install --global turbo@2.8.9 RUN turbo prune @repo/website --docker FROM node-pnpm AS installer diff --git a/apps/website/app/[locale]/(main)/blog/[slug]/page.tsx b/apps/website/app/[locale]/(main)/blog/[slug]/page.tsx index 60ba5e9..2a76bed 100644 --- a/apps/website/app/[locale]/(main)/blog/[slug]/page.tsx +++ b/apps/website/app/[locale]/(main)/blog/[slug]/page.tsx @@ -13,9 +13,7 @@ interface BlogPostPageProps { }> } -export const generateMetadata = async ( - props: BlogPostPageProps, -): Promise => { +export const generateMetadata = async (props: BlogPostPageProps): Promise => { const { slug } = await props.params const blogPost = await getBlogPostBySlug(slug) if (blogPost == null) { @@ -37,9 +35,7 @@ export const generateMetadata = async ( } } -export const generateStaticParams = async (): Promise< - Array<{ slug: string }> -> => { +export const generateStaticParams = async (): Promise> => { const posts = await getBlogPosts() return posts.map((post) => { return { diff --git a/apps/website/app/[locale]/(main)/blog/page.tsx b/apps/website/app/[locale]/(main)/blog/page.tsx index 1d12c03..7273bf7 100644 --- a/apps/website/app/[locale]/(main)/blog/page.tsx +++ b/apps/website/app/[locale]/(main)/blog/page.tsx @@ -2,18 +2,13 @@ import { getBlogPosts } from "@repo/blog" import { BlogPosts } from "@repo/blog/BlogPosts" import type { LocaleProps } from "@repo/i18n/routing" import { MainLayout } from "@repo/ui/Layout/MainLayout" -import { - Section, - SectionDescription, - SectionTitle, -} from "@repo/ui/Layout/Section" +import { Section, SectionDescription, SectionTitle } from "@repo/ui/Layout/Section" import { LOCALE_DEFAULT } from "@repo/utils/constants" import type { Metadata } from "next" import { setRequestLocale } from "next-intl/server" const title = "Blog | Théo LUDWIG" -const description = - "The latest news about my journey of learning computer science." +const description = "The latest news about my journey of learning computer science." export const generateMetadata = async (): Promise => { return { diff --git a/apps/website/app/[locale]/curriculum-vitae/layout.tsx b/apps/website/app/[locale]/curriculum-vitae/layout.tsx index 3c7708b..a93dd9e 100644 --- a/apps/website/app/[locale]/curriculum-vitae/layout.tsx +++ b/apps/website/app/[locale]/curriculum-vitae/layout.tsx @@ -9,9 +9,7 @@ interface CurriculumVitaeLayoutProps extends React.PropsWithChildren { }> } -const CurriculumVitaeLayout: React.FC = async ( - props, -) => { +const CurriculumVitaeLayout: React.FC = async (props) => { const { children, params } = props const { locale } = await params diff --git a/apps/website/app/[locale]/layout.tsx b/apps/website/app/[locale]/layout.tsx index d0f6768..7fd40b8 100644 --- a/apps/website/app/[locale]/layout.tsx +++ b/apps/website/app/[locale]/layout.tsx @@ -3,11 +3,7 @@ import type { Locale } from "@repo/utils/constants" import { LOCALES } from "@repo/utils/constants" import type { Metadata, Viewport } from "next" import { NextIntlClientProvider } from "next-intl" -import { - getMessages, - getTranslations, - setRequestLocale, -} from "next-intl/server" +import { getMessages, getTranslations, setRequestLocale } from "next-intl/server" import Script from "next/script" const DOMAIN = "theoludwig.fr" @@ -85,14 +81,9 @@ const LocaleLayout: React.FC = async (props) => { return ( - - {children} - + {children} -