Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Mar 27, 2024
1 parent 9dd9210 commit c6a9fb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
7 changes: 5 additions & 2 deletions code/lib/core-common/src/js-package-manager/Yarn2Proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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`,
});
}
}
Expand Down

0 comments on commit c6a9fb1

Please sign in to comment.