From 3a1ac38940ffd5f81c2d1277dad787d3b0c66124 Mon Sep 17 00:00:00 2001 From: gitphill Date: Tue, 30 Jun 2020 13:17:12 +0100 Subject: [PATCH] feat: yarn v2 support and workspaces alt config Typescript 'dom' compiler option is required by transitive dependency @yarnpkg/core introduced by yarn v2 feature. Fix type issue with setInterval cause by dom compiler option. --- package.json | 2 +- src/lib/spinner.ts | 4 ++-- tsconfig.json | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e7e2c6b3afc..46503ab2cf4 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "snyk-gradle-plugin": "3.5.1", "snyk-module": "3.1.0", "snyk-mvn-plugin": "2.17.1", - "snyk-nodejs-lockfile-parser": "1.22.0", + "snyk-nodejs-lockfile-parser": "1.25.0", "snyk-nuget-plugin": "1.18.1", "snyk-php-plugin": "1.9.0", "snyk-policy": "1.14.1", diff --git a/src/lib/spinner.ts b/src/lib/spinner.ts index de432954717..e402591d4dc 100644 --- a/src/lib/spinner.ts +++ b/src/lib/spinner.ts @@ -91,7 +91,7 @@ function spinner(opt: SpinnerOptions) { let delay = typeof opt.delay === 'number' ? opt.delay : 2; - const interval = setInterval(() => { + const interval = (setInterval(() => { if (--delay >= 0) { return; } @@ -99,7 +99,7 @@ function spinner(opt: SpinnerOptions) { const c = sprite[s]; str.write(c + ' ' + (opt.label || '') + CR); wrote = true; - }, ms); + }, ms) as unknown) as NodeJS.Timer; const unref = typeof opt.unref === 'boolean' ? opt.unref : true; if (unref && typeof interval.unref === 'function') { diff --git a/tsconfig.json b/tsconfig.json index 64bcbdb1ed9..8e355ebe17e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "target": "es2017", "lib": [ "es2017", + "dom" ], "module": "commonjs", "allowJs": true,