From 4993ab61f2d8d2dece42d2411d0c2d2c9d0e6f2b Mon Sep 17 00:00:00 2001 From: willtheorangeguy Date: Fri, 28 Aug 2026 20:13:19 -0600 Subject: [PATCH] fix: resolve all 38 pre-existing ESLint errors - astro.config.ts: drop the unnecessary `as any` cast on the tailwindcss() vite plugin; astro check passes without it. - eslint.config.js: add a scoped override for public/speedtest/** (vendored LibreSpeed code, GNU LGPLv3) that turns off no-console (intentional logging) and no-unused-expressions (an IE11 feature-detection idiom), and configures no-unused-vars with caughtErrors: "none" for its many deliberately-ignored `catch (e) {}` blocks, instead of rewriting upstream code. - Remove genuinely unused imports: IconArchive (Header.astro), IconBluesky and SITE (constants.ts), ShareLinks (PostDetails.astro), IconRss (index.astro) -- verified via grep that none are used. - PostDetails.astro: wire the already-destructured `hideEditPost` frontmatter field through to , which accepts it as a prop to hide the edit link per post. It was previously computed but silently dropped, so the documented hideEditPost frontmatter option (see EditPost.stories.ts) never had any effect. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Y38yxr1x54TZQgwdcHUbtE --- astro.config.ts | 2 +- eslint.config.js | 18 ++++++++++++++++++ src/components/Header.astro | 1 - src/constants.ts | 2 -- src/layouts/PostDetails.astro | 3 +-- src/pages/index.astro | 1 - 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/astro.config.ts b/astro.config.ts index 8ed199f4..e0e1c4fe 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -25,7 +25,7 @@ export default defineConfig({ }, }, vite: { - plugins: [tailwindcss() as any], + plugins: [tailwindcss()], optimizeDeps: { exclude: ["@resvg/resvg-js"], }, diff --git a/eslint.config.js b/eslint.config.js index e2579a93..6d49da6c 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -15,6 +15,24 @@ export default [ }, { rules: { "no-console": "error" } }, { files: ["scripts/**"], rules: { "no-console": "off" } }, + { + // Vendored third-party code (LibreSpeed: https://github.com/librespeed/speedtest/, + // GNU LGPLv3), copied as-is rather than authored in this project's style. + // These rules don't fit its dialect/conventions, so they're relaxed here + // instead of rewriting upstream logic: + // - no-console: the speed test intentionally logs progress/errors to the console. + // - no-unused-vars: `caughtErrors: "none"` allows the many `catch (e) {}` blocks + // that deliberately ignore the caught error (a common upstream pattern here). + // - no-unused-expressions: speedtest_worker.js uses a bare property access + // (`xhr[i].upload.onprogress;`) inside a try/catch purely for its side effect of + // throwing on unsupported browsers (IE11 feature detection), not as a mistake. + files: ["public/speedtest/**"], + rules: { + "no-console": "off", + "@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "none" }], + "@typescript-eslint/no-unused-expressions": "off", + }, + }, { ignores: [ "dist/**", diff --git a/src/components/Header.astro b/src/components/Header.astro index 3e139c47..1d10c7a9 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -3,7 +3,6 @@ import Hr from "./Hr.astro"; import IconX from "@/assets/icons/IconX.svg"; import IconMoon from "@/assets/icons/IconMoon.svg"; import IconSearch from "@/assets/icons/IconSearch.svg"; -import IconArchive from "@/assets/icons/IconArchive.svg"; import IconSunHigh from "@/assets/icons/IconSunHigh.svg"; import IconMenuDeep from "@/assets/icons/IconMenuDeep.svg"; import LinkButton from "./LinkButton.astro"; diff --git a/src/constants.ts b/src/constants.ts index b3d9fcbd..2ef78181 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -4,11 +4,9 @@ import IconInstagram from "@/assets/icons/instagram-brands.svg"; import IconLinkedin from "@/assets/icons/linkedin-brands.svg"; import IconTwitter from "@/assets/icons/x-twitter-brands.svg"; import IconMastodon from "@/assets/icons/mastodon-brands.svg"; -import IconBluesky from "@/assets/icons/bluesky-brands.svg"; import IconStackOverflow from "@/assets/icons/stack-overflow-brands.svg"; import IconYouTube from "@/assets/icons/youtube-brands.svg"; import IconSteam from "@/assets/icons/steam-brands.svg"; -import { SITE } from "@/config"; import type { GiscusProps } from "@giscus/react"; export const SOCIALS = [ diff --git a/src/layouts/PostDetails.astro b/src/layouts/PostDetails.astro index 17fa6b8c..8ddf9322 100644 --- a/src/layouts/PostDetails.astro +++ b/src/layouts/PostDetails.astro @@ -6,7 +6,6 @@ import Footer from "@/components/Footer.astro"; import Tag from "@/components/Tag.astro"; import Datetime from "@/components/Datetime.astro"; import EditPost from "@/components/EditPost.astro"; -import ShareLinks from "@/components/ShareLinks.astro"; import BackButton from "@/components/BackButton.astro"; import Comments from "@/components/Comments"; import { getPath } from "@/utils/getPath"; @@ -112,7 +111,7 @@ const nextPost =
- +