From 1de13d22f6df22c0b621fe1b3147afd1523e198f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20Kleizer?= Date: Wed, 20 Nov 2024 09:49:10 +0100 Subject: [PATCH] chore: more lint fixes for use-formatters --- frontend/composables/use-formatters.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/composables/use-formatters.ts b/frontend/composables/use-formatters.ts index 8f05d23c..618ac85b 100644 --- a/frontend/composables/use-formatters.ts +++ b/frontend/composables/use-formatters.ts @@ -1,6 +1,6 @@ import { useI18n } from "vue-i18n"; import { format, formatDistance } from "date-fns"; -/*eslint import/namespace: ['error', { allowComputed: true }]*/ +/* eslint import/namespace: ['error', { allowComputed: true }] */ import * as Locales from "date-fns/locale"; const cache = { @@ -33,9 +33,7 @@ function getLocale() { const localeCode = (t?.locale?.value as string) ?? "en-US"; const lang = localeCode.length > 1 ? localeCode.substring(0, 2) : localeCode; const region = localeCode.length > 2 ? localeCode.substring(3) : ""; - return ( - Locales[(lang + region) as keyof typeof Locales] ?? Locales[lang as keyof typeof Locales] ?? Locales.enUS - ); + return Locales[(lang + region) as keyof typeof Locales] ?? Locales[lang as keyof typeof Locales] ?? Locales.enUS; } export function useLocaleTimeAgo(date: Date) {