Skip to content

Commit

Permalink
Fix bad import
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Feb 29, 2024
1 parent 63ff19a commit eb0c95f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions scripts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
5 changes: 2 additions & 3 deletions scripts/lint-i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()) ?? [];
Expand All @@ -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, "")) {
Expand Down

0 comments on commit eb0c95f

Please sign in to comment.