Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(website): fix typecheck issues
Elian Doran4f72f81a958a
diff --git a/apps/website/src/i18n.ts b/apps/website/src/i18n.tsindex 6f0ae9fbfb..5b99f961b6 100644--- a/apps/website/src/i18n.ts+++ b/apps/website/src/i18n.ts@@ -9,12 +9,14 @@ interface Locale {i18next.use(initReactI18next);const localeFiles = import.meta.glob("./translations/*/translation.json", { eager: true });-const resources: Record<string, Record<string, string>> = {};-for (const [ path, translations ] of Object.entries(localeFiles)) {+const resources: Record<string, Record<string, Record<string, string>>> = {};+for (const [ path, _translations ] of Object.entries(localeFiles)) {const id = path.split("/").at(-2);+ if (!id) continue;if (!resources[id]) resources[id] = {};- if ("default" in (translations as any)) {- resources[id].translation = (translations as any).default;+ const translations = _translations as { default: Record<string, string> } | Record<string, string>;+ if ("default" in translations) {+ resources[id].translation = translations.default as Record<string, string>;} else {resources[id].translation = translations;}diff --git a/apps/website/tsconfig.json b/apps/website/tsconfig.jsonindex 48581e18c4..4d67635d71 100644--- a/apps/website/tsconfig.json+++ b/apps/website/tsconfig.json@@ -9,6 +9,9 @@"jsx": "react-jsx","jsxImportSource": "preact","skipLibCheck": true,+ "types": [+ "vite/client"+ ],"paths": {"react": ["../../node_modules/preact/compat/"],"react-dom": ["../../node_modules/preact/compat/"]