fix(ci): resolve all lint errors for GitHub Actions

- Remove unused SupportedLocale import in results.tsx
- Remove unused webroot variable in public/i18n.js
- Configure knip.json to ignore i18n public API exports
- Add language-selector and language-option to ESLint ignore list
- Auto-fix Prettier formatting across all files
- Fix better-tailwindcss line wrapping issues
This commit is contained in:
Your Name 2026-01-20 12:16:13 +08:00
parent 8089fa0853
commit 569c572e62
16 changed files with 621 additions and 508 deletions

View file

@ -1,17 +1,13 @@
import { Elysia } from "elysia";
import {
type SupportedLocale,
createTranslator,
detectLocale,
getLocale,
} from "./index";
import { type SupportedLocale, createTranslator, detectLocale, getLocale } from "./index";
/**
* Elysia plugin for i18n/locale handling
* Adds locale detection and translator to the context
*/
export const localeService = new Elysia({ name: "locale/service" })
.derive({ as: "global" }, ({ request }) => {
export const localeService = new Elysia({ name: "locale/service" }).derive(
{ as: "global" },
({ request }) => {
// Get locale from cookie (parsed from headers) or detect from Accept-Language header
const cookieHeader = request.headers.get("cookie") ?? "";
const acceptLanguage = request.headers.get("accept-language") ?? undefined;
@ -37,7 +33,8 @@ export const localeService = new Elysia({ name: "locale/service" })
locale,
t: translator,
};
});
},
);
export type LocaleContext = {
locale: SupportedLocale;