From 64c1ad6de30cba14bdfa209f020fae18d2e85fb2 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Thu, 23 May 2024 01:21:03 +0200 Subject: [PATCH] Fix i18n type checking --- src/i18n/i18next.d.ts | 8 ++++++-- tsconfig.json | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/i18n/i18next.d.ts b/src/i18n/i18next.d.ts index 14933e37..21bc24e3 100644 --- a/src/i18n/i18next.d.ts +++ b/src/i18n/i18next.d.ts @@ -7,11 +7,15 @@ */ import 'i18next'; -import { resources } from '@/i18n/translations'; +import en from 'public/locales/en.json'; + +const resources = { + translation: en, +}; declare module 'i18next' { interface CustomTypeOptions { returnNull: false; - resources: typeof resources.en; + resources: typeof resources; } } diff --git a/tsconfig.json b/tsconfig.json index 03f7b1d1..2c2d0021 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,6 +27,7 @@ "jsx": "react-jsx", /* Linting */ "strict": true, + "strictNullChecks": true, "noUnusedLocals": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true @@ -34,7 +35,7 @@ "include": [ "src" ], - "exclude": ["**/node_modules", "**/.*/"], + "exclude": ["**/node_modules"], "references": [ { "path": "./tsconfig.node.json"