diff --git a/code/lib/core-common/src/js-package-manager/Yarn2Proxy.test.ts b/code/lib/core-common/src/js-package-manager/Yarn2Proxy.test.ts index f024d19c1133..985d0dbecf83 100644 --- a/code/lib/core-common/src/js-package-manager/Yarn2Proxy.test.ts +++ b/code/lib/core-common/src/js-package-manager/Yarn2Proxy.test.ts @@ -1,5 +1,4 @@ import { describe, beforeEach, it, expect, vi } from 'vitest'; -import dedent from 'ts-dedent'; import { Yarn2Proxy } from './Yarn2Proxy'; describe('Yarn 2 Proxy', () => { diff --git a/code/lib/core-common/src/js-package-manager/Yarn2Proxy.ts b/code/lib/core-common/src/js-package-manager/Yarn2Proxy.ts index 7014357cc44b..08062cf4081c 100644 --- a/code/lib/core-common/src/js-package-manager/Yarn2Proxy.ts +++ b/code/lib/core-common/src/js-package-manager/Yarn2Proxy.ts @@ -36,6 +36,7 @@ const CRITICAL_YARN2_ERROR_CODES = { YN0083: 'AUTOMERGE_GIT_ERROR', }; +// @ts-expect-error Might be useful to have this in the future const YARN2_ERROR_CODES = { ...CRITICAL_YARN2_ERROR_CODES, YN0000: 'UNNAMED', @@ -306,10 +307,12 @@ export class Yarn2Proxy extends JsPackageManager { while ((match = regex.exec(logs)) !== null) { const code = match[1]; const message = match[2].replace(/[┌│└]/g, '').trim(); - if (CRITICAL_YARN2_ERROR_CODES[code]) { + if (code in CRITICAL_YARN2_ERROR_CODES) { errorCodesWithMessages.push({ code, - message: `${CRITICAL_YARN2_ERROR_CODES[code]}\n-> ${message}\n`, + message: `${ + CRITICAL_YARN2_ERROR_CODES[code as keyof typeof CRITICAL_YARN2_ERROR_CODES] + }\n-> ${message}\n`, }); } }