fix: add prefer-array-some rule (#5109)

This commit is contained in:
LongYinan
2023-11-29 04:43:43 +00:00
parent 23cfc58fe2
commit d267029761
5 changed files with 7 additions and 6 deletions

View File

@@ -57,9 +57,9 @@ const standardizeLocale = (language: string) => {
} else if (language.slice(0, 2).toLowerCase() === 'zh') {
language = 'zh-Hant';
}
if (LOCALES.find(locale => locale.tag === language)) return language;
if (LOCALES.some(locale => locale.tag === language)) return language;
if (
LOCALES.find(locale => locale.tag === language.slice(0, 2).toLowerCase())
LOCALES.some(locale => locale.tag === language.slice(0, 2).toLowerCase())
) {
return language.slice(0, 2).toLowerCase();
}