From ad9dcb34f4c31da420a3fb5cab971106cae00ed7 Mon Sep 17 00:00:00 2001 From: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com> Date: Mon, 27 May 2024 18:30:39 -0700 Subject: [PATCH] Exit 1 with lint-intl failures --- build/intl-linter/linter.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/intl-linter/linter.ts b/build/intl-linter/linter.ts index 809a1d9b12..0abbb5edd9 100644 --- a/build/intl-linter/linter.ts +++ b/build/intl-linter/linter.ts @@ -136,6 +136,8 @@ async function lintMessages() { const jsonAst = parseJsonToAst(file); + let failed = false; + assert(jsonAst.type === 'Object', 'Expected an object'); for (const topProp of jsonAst.children) { if (topProp.key.value === 'smartling') { @@ -202,8 +204,14 @@ async function lintMessages() { console.error(chalk` {dim in ${key} is "}{red ${icuMessage}}{dim "}`); // eslint-disable-next-line no-console console.error(); + + failed = true; } } + + if (failed) { + process.exit(1); + } } lintMessages().catch(error => {