From 078dac7a7071fbb5c79710df184265eb611ae55e Mon Sep 17 00:00:00 2001 From: daz Date: Wed, 9 Apr 2025 16:40:33 -0600 Subject: [PATCH] Lint: Prefix unused variables/parameters --- sources/src/caching/cache-cleaner.ts | 2 +- sources/src/develocity/short-lived-token.ts | 6 +++--- sources/src/wrapper-validation/checksums.ts | 2 +- sources/test/jest/cache-cleanup.test.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sources/src/caching/cache-cleaner.ts b/sources/src/caching/cache-cleaner.ts index 5b25931..82e4db1 100644 --- a/sources/src/caching/cache-cleaner.ts +++ b/sources/src/caching/cache-cleaner.ts @@ -44,7 +44,7 @@ export class CacheCleaner { .filter(Boolean) as string[] return await provisioner.provisionGradleWithVersionAtLeast(preferredVersion, wrapperScripts) - } catch (e) { + } catch (_) { // Ignore the case where the preferred version cannot be located in https://services.gradle.org/versions/all. // This can happen for snapshot Gradle versions. core.info( diff --git a/sources/src/develocity/short-lived-token.ts b/sources/src/develocity/short-lived-token.ts index 37362ba..196ff0e 100644 --- a/sources/src/develocity/short-lived-token.ts +++ b/sources/src/develocity/short-lived-token.ts @@ -106,7 +106,7 @@ class ShortLivedTokenClient { // This should be only 404 attempts++ if (attempts === this.maxRetries) { - return new Promise((resolve, reject) => + return new Promise((_resolve, reject) => reject( new Error( `Develocity short lived token request failed ${serverUrl} with status code ${response.message.statusCode}` @@ -117,12 +117,12 @@ class ShortLivedTokenClient { } catch (error) { attempts++ if (attempts === this.maxRetries) { - return new Promise((resolve, reject) => reject(error)) + return new Promise((_resolve, reject) => reject(error)) } } await new Promise(resolve => setTimeout(resolve, this.retryInterval)) } - return new Promise((resolve, reject) => reject(new Error('Illegal state'))) + return new Promise((_resolve, reject) => reject(new Error('Illegal state'))) } } diff --git a/sources/src/wrapper-validation/checksums.ts b/sources/src/wrapper-validation/checksums.ts index f6bcc14..f85393e 100644 --- a/sources/src/wrapper-validation/checksums.ts +++ b/sources/src/wrapper-validation/checksums.ts @@ -80,7 +80,7 @@ async function addDistributionSnapshotChecksumUrls(checksumUrls: [string, string // // Find all links ending with '-wrapper.jar.sha256' const wrapperChecksumLinks = $('a[href$="-wrapper.jar.sha256"]') - wrapperChecksumLinks.each((index, element) => { + wrapperChecksumLinks.each((_index, element) => { const url = $(element).attr('href')! // Extract the version from the url diff --git a/sources/test/jest/cache-cleanup.test.ts b/sources/test/jest/cache-cleanup.test.ts index 01644e1..4c8727c 100644 --- a/sources/test/jest/cache-cleanup.test.ts +++ b/sources/test/jest/cache-cleanup.test.ts @@ -80,14 +80,14 @@ test('will cleanup unused gradle versions', async () => { }) async function runGradleBuild(projectRoot: string, args: string, version: string = '3.1'): Promise { - const status31 = await exec.exec(`gradle -g HOME --no-daemon --build-cache -Dcommons_math3_version="${version}" ${args}`, [], { + await exec.exec(`gradle -g HOME --no-daemon --build-cache -Dcommons_math3_version="${version}" ${args}`, [], { cwd: projectRoot }) console.log(`Gradle User Home initialized with commons_math3_version=${version} ${args}`) } async function runGradleWrapperBuild(projectRoot: string, args: string, version: string = '3.1'): Promise { - const status31 = await exec.exec(`./gradlew -g HOME --no-daemon --build-cache -Dcommons_math3_version="${version}" ${args}`, [], { + await exec.exec(`./gradlew -g HOME --no-daemon --build-cache -Dcommons_math3_version="${version}" ${args}`, [], { cwd: projectRoot }) console.log(`Gradle User Home initialized with commons_math3_version="${version}" ${args}`)