From 95e24b7207b5b5022ecdd9cf91cb641ecccf46af Mon Sep 17 00:00:00 2001 From: Emmanuel Pelletier Date: Thu, 17 Apr 2025 17:07:56 +0200 Subject: [PATCH] website: fix typescript warnings when running `astro check` see https://github.com/withastro/astro/issues/10174#issuecomment-2026297879 for the why the tsconfig.json change --- website/bin/transform-source-backgrounds.mjs | 2 +- website/src/components/GaufrePage.astro | 2 +- website/src/components/HomepageGenerator.tsx | 2 +- website/src/pages/api/v1/services-local.json.ts | 3 +-- website/src/pages/api/v1/services.json.ts | 3 +-- website/tsconfig.json | 3 ++- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/website/bin/transform-source-backgrounds.mjs b/website/bin/transform-source-backgrounds.mjs index fcd277e..4850d6a 100644 --- a/website/bin/transform-source-backgrounds.mjs +++ b/website/bin/transform-source-backgrounds.mjs @@ -21,7 +21,7 @@ async function resizeSourceBackgrounds() { .toBuffer() const backgrounds = await readdir(sourcesDir) - backgrounds.forEach((backgroundFile, i) => { + backgrounds.forEach((backgroundFile) => { const srcPath = path.join(sourcesDir, backgroundFile) const backgroundName = path.parse(backgroundFile).name const jpegPath = path.join(outputDir, `${backgroundName}.jpg`) diff --git a/website/src/components/GaufrePage.astro b/website/src/components/GaufrePage.astro index 58bcb45..5436e5c 100644 --- a/website/src/components/GaufrePage.astro +++ b/website/src/components/GaufrePage.astro @@ -315,7 +315,7 @@ const useSubsettedFont = import.meta.env.PUBLIC_USE_GAUFRE_SUBSETTED_FONT !== "0 { services .filter(({ enabled }) => !!enabled) - .map(({ id, name, url, beta }, i) => { + .map(({ id, name, url, beta }, i: number) => { const logo = logos[`/src/assets/logos/${id}.svg`] || logos[`/src/assets/logos/${id}.jpg`] || diff --git a/website/src/components/HomepageGenerator.tsx b/website/src/components/HomepageGenerator.tsx index a15b2e0..22e4c20 100644 --- a/website/src/components/HomepageGenerator.tsx +++ b/website/src/components/HomepageGenerator.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react" +import { useState } from "react" import { renderToStaticMarkup } from "react-dom/server" import services from "@/data/services.json" import Code from "./Code" diff --git a/website/src/pages/api/v1/services-local.json.ts b/website/src/pages/api/v1/services-local.json.ts index f1c9e30..5e1fc2f 100644 --- a/website/src/pages/api/v1/services-local.json.ts +++ b/website/src/pages/api/v1/services-local.json.ts @@ -1,7 +1,6 @@ -import type { APIContext } from "astro" import services from "@/data/services-local.json" -export async function GET({ url }: APIContext) { +export async function GET() { const response = new Response( JSON.stringify( services diff --git a/website/src/pages/api/v1/services.json.ts b/website/src/pages/api/v1/services.json.ts index e9554cb..606c95e 100644 --- a/website/src/pages/api/v1/services.json.ts +++ b/website/src/pages/api/v1/services.json.ts @@ -1,7 +1,6 @@ -import type { APIContext } from "astro" import services from "@/data/services.json" -export async function GET({ url }: APIContext) { +export async function GET() { const response = new Response( JSON.stringify( services diff --git a/website/tsconfig.json b/website/tsconfig.json index b6419ce..5ef9e4a 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -7,6 +7,7 @@ "@/*": ["src/*"] }, "jsx": "react-jsx", - "jsxImportSource": "react" + "jsxImportSource": "react", + "outDir": "dist" } }