From 83477bba348665c7556e12ae9b5bac735f8d6c26 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Wed, 16 Jul 2025 01:00:52 -0400 Subject: [PATCH] chore: linting --- .../components/SidePanel/Parameters/DynamicCheckbox.tsx | 8 ++++++-- client/src/locales/Translation.spec.ts | 5 +++-- client/src/routes/RouteErrorBoundary.tsx | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/src/components/SidePanel/Parameters/DynamicCheckbox.tsx b/client/src/components/SidePanel/Parameters/DynamicCheckbox.tsx index 277186e8b2..c69453506e 100644 --- a/client/src/components/SidePanel/Parameters/DynamicCheckbox.tsx +++ b/client/src/components/SidePanel/Parameters/DynamicCheckbox.tsx @@ -62,7 +62,7 @@ function DynamicCheckbox({ htmlFor={`${settingKey}-dynamic-checkbox`} className="text-left text-sm font-medium" > - {labelCode ? localize(label as TranslationKeys) ?? label : label || settingKey}{' '} + {labelCode ? (localize(label as TranslationKeys) ?? label) : label || settingKey}{' '} {showDefault && ( ({localize('com_endpoint_default')}:{' '} @@ -81,7 +81,11 @@ function DynamicCheckbox({ {description && ( )} diff --git a/client/src/locales/Translation.spec.ts b/client/src/locales/Translation.spec.ts index 78fc105439..6c6e1b7ac8 100644 --- a/client/src/locales/Translation.spec.ts +++ b/client/src/locales/Translation.spec.ts @@ -2,6 +2,7 @@ import i18n from './i18n'; import English from './en/translation.json'; import French from './fr/translation.json'; import Spanish from './es/translation.json'; +import { TranslationKeys } from '~/hooks'; describe('i18next translation tests', () => { // Ensure i18next is initialized before any tests run @@ -34,7 +35,7 @@ describe('i18next translation tests', () => { it('should return the key itself for an invalid key', () => { i18n.changeLanguage('en'); - expect(i18n.t('invalid-key')).toBe('invalid-key'); // Returns the key itself + expect(i18n.t('invalid-key' as TranslationKeys)).toBe('invalid-key'); // Returns the key itself }); it('should correctly format placeholders in the translation', () => { @@ -44,4 +45,4 @@ describe('i18next translation tests', () => { i18n.changeLanguage('fr'); expect(i18n.t('com_endpoint_default_with_num', { 0: 'Marie' })).toBe('par défaut : Marie'); }); -}); \ No newline at end of file +}); diff --git a/client/src/routes/RouteErrorBoundary.tsx b/client/src/routes/RouteErrorBoundary.tsx index cf6633f984..f112e29d7d 100644 --- a/client/src/routes/RouteErrorBoundary.tsx +++ b/client/src/routes/RouteErrorBoundary.tsx @@ -1,3 +1,4 @@ +/* eslint-disable i18next/no-literal-string */ import { Button } from '@librechat/client'; import { useRouteError } from 'react-router-dom'; import logger from '~/utils/logger';