chore: linting

This commit is contained in:
Danny Avila 2025-07-16 01:00:52 -04:00 committed by Marco Beretta
parent 5476029bca
commit 83477bba34
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
3 changed files with 10 additions and 4 deletions

View file

@ -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 && (
<small className="opacity-40">
({localize('com_endpoint_default')}:{' '}
@ -81,7 +81,11 @@ function DynamicCheckbox({
</HoverCardTrigger>
{description && (
<OptionHover
description={descriptionCode ? localize(description as TranslationKeys) ?? description : description}
description={
descriptionCode
? (localize(description as TranslationKeys) ?? description)
: description
}
side={ESide.Left}
/>
)}

View file

@ -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');
});
});
});

View file

@ -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';