From eb0c95ff7039b8791b820feb486dea5df7447aab Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 29 Feb 2024 10:39:44 +0000 Subject: [PATCH] Fix bad import --- scripts/common.ts | 2 ++ scripts/lint-i18n.ts | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/common.ts b/scripts/common.ts index f26d900..789447d 100644 --- a/scripts/common.ts +++ b/scripts/common.ts @@ -61,3 +61,5 @@ export function getTKey(arg: Node): string | null { export function isPluralisedTranslation(translation: Translations[string]): translation is PluralisedTranslation { return typeof translation === "object" && "other" in translation; } + +export type { PluralisedTranslation, Translations, Translation }; diff --git a/scripts/lint-i18n.ts b/scripts/lint-i18n.ts index 49f8766..fecd7b1 100644 --- a/scripts/lint-i18n.ts +++ b/scripts/lint-i18n.ts @@ -24,8 +24,7 @@ limitations under the License. * Usage: node scripts/lint-i18n.js */ -import { getTranslations, isPluralisedTranslation } from "./common"; -import { KEY_SEPARATOR, Translation, Translations } from "../src"; +import { getTranslations, isPluralisedTranslation, NESTING_KEY, Translation, Translations } from "./common"; const hardcodedWords = process.env.HARDCODED_WORDS?.toLowerCase().split("\n").map(k => k.trim()) ?? []; const allowedHardcodedKeys = process.env.ALLOWED_HARDCODED_KEYS?.split("\n").map(k => k.trim()) ?? []; @@ -46,7 +45,7 @@ function expandTranslations(translation: Translation): string[] { function lintTranslation(keys: string[], value: Translation): boolean { const key = keys[keys.length - 1]; - const fullKey = keys.join(KEY_SEPARATOR); + const fullKey = keys.join(NESTING_KEY); // Check for invalid characters in the translation key if (!!key.replace(/[a-z0-9@_.]+/gi, "")) {