diff --git a/package.json b/package.json index 109024c..1f842d2 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "node": ">= 16" }, "volta": { - "node": "16.0.0" + "node": "16.14.0" }, "scripts": { "clean": "rm -rf dist/", diff --git a/src/runtime/configs.ts b/src/runtime/configs.ts index 7955938..ead76e3 100644 --- a/src/runtime/configs.ts +++ b/src/runtime/configs.ts @@ -1,4 +1,4 @@ -import { getCanonicalLocales } from '@formatjs/intl-getcanonicallocales' +import { getCanonicalLocales } from '@formatjs/intl-getcanonicallocales'; import { $locale, getCurrentLocale, getPossibleLocales } from './stores/locale'; import { hasLocaleQueue } from './modules/loaderQueue'; @@ -81,13 +81,16 @@ export function init(opts: ConfigureOptionsInit) { const { formats, ...rest } = opts; // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing let initialLocale = opts.fallbackLocale; - if ( opts.initialLocale ) { + + if (opts.initialLocale) { try { const canonicalizedLocale = getCanonicalLocales(opts.initialLocale); - if ( canonicalizedLocale.length >= 1 ) { + + if (canonicalizedLocale.length >= 1) { initialLocale = canonicalizedLocale[0]; } - } catch {} + // eslint-disable-next-line no-empty + } catch (e) {} } if (rest.warnOnMissingMessages) {