diff --git a/services/gitlab/gitlab-coverage.service.js b/services/gitlab/gitlab-coverage.service.js index f7b4c045d8b9bd..abc9ae249797c1 100644 --- a/services/gitlab/gitlab-coverage.service.js +++ b/services/gitlab/gitlab-coverage.service.js @@ -95,13 +95,7 @@ export default class GitlabCoverage extends BaseSvgScrapingService { } } - async fetch({ - user, - repo, - branch, - gitlab_url: baseUrl = 'https://gitlab.com', - job_name: jobName, - }) { + async fetch({ user, repo, branch, baseUrl = 'https://gitlab.com', jobName }) { // Since the URL doesn't return a usable value when an invalid job name is specified, // it is recommended to not use the query param at all if not required jobName = jobName ? `?job=${jobName}` : '' @@ -124,13 +118,16 @@ export default class GitlabCoverage extends BaseSvgScrapingService { return Number(coverage.slice(0, -1)) } - async handle({ user, repo, branch }, { gitlab_url, job_name }) { + async handle( + { user, repo, branch }, + { gitlab_url: baseUrl, job_name: jobName } + ) { const { message: coverage } = await this.fetch({ user, repo, branch, - gitlab_url, - job_name, + baseUrl, + jobName, }) return this.constructor.render({ coverage: this.constructor.transform({ coverage }), diff --git a/services/ore/ore-sponge-versions.service.js b/services/ore/ore-sponge-versions.service.js index e7689bdc1842bb..3603b3ef23eb2a 100644 --- a/services/ore/ore-sponge-versions.service.js +++ b/services/ore/ore-sponge-versions.service.js @@ -32,9 +32,9 @@ export default class OreSpongeVersions extends BaseOreService { } transform({ data }) { - const { promoted_versions } = data + const { promoted_versions: promotedVersions } = data return { - versions: promoted_versions + versions: promotedVersions .reduce((acc, { tags }) => acc.concat(tags), []) .filter(({ name }) => name.toLowerCase() === 'sponge') .map(({ display_data: displayData }) => displayData) diff --git a/services/ore/ore-version.service.js b/services/ore/ore-version.service.js index cb7fa47cc4d2f4..b59e7cdb8e051c 100644 --- a/services/ore/ore-version.service.js +++ b/services/ore/ore-version.service.js @@ -33,12 +33,10 @@ export default class OreVersion extends BaseOreService { } transform({ data }) { - const { promoted_versions } = data + const { promoted_versions: promotedVersions } = data return { version: - promoted_versions.length === 0 - ? undefined - : promoted_versions[0].version, + promotedVersions.length === 0 ? undefined : promotedVersions[0].version, } } diff --git a/services/steam/steam-workshop.service.js b/services/steam/steam-workshop.service.js index b5620079885ee5..8624bee2ac0290 100644 --- a/services/steam/steam-workshop.service.js +++ b/services/steam/steam-workshop.service.js @@ -358,8 +358,8 @@ class SteamFileDownloads extends SteamFileService { static defaultBadgeData = { label: 'downloads' } - async onRequest({ response: { lifetime_subscriptions } }) { - return renderDownloadsBadge({ downloads: lifetime_subscriptions }) + async onRequest({ response: { lifetime_subscriptions: downloads } }) { + return renderDownloadsBadge({ downloads }) } } diff --git a/services/text-formatters.spec.js b/services/text-formatters.spec.js index efcfae4c15b96d..e49f2e48663e42 100644 --- a/services/text-formatters.spec.js +++ b/services/text-formatters.spec.js @@ -39,6 +39,7 @@ describe('Text formatters', function () { test(metric, () => { /* eslint-disable no-loss-of-precision */ + /* eslint-disable @typescript-eslint/no-loss-of-precision */ given(999).expect('999') given(1000).expect('1k') given(1100).expect('1.1k') diff --git a/services/weblate/weblate-project-translated-percentage.service.js b/services/weblate/weblate-project-translated-percentage.service.js index b4a2481ed0dfb8..1d31de3bb807ef 100644 --- a/services/weblate/weblate-project-translated-percentage.service.js +++ b/services/weblate/weblate-project-translated-percentage.service.js @@ -58,7 +58,10 @@ export default class WeblateProjectTranslatedPercentage extends WeblateBase { } async handle({ project }, { server }) { - const { translated_percent } = await this.fetch({ project, server }) - return this.constructor.render({ translatedPercent: translated_percent }) + const { translated_percent: translatedPercent } = await this.fetch({ + project, + server, + }) + return this.constructor.render({ translatedPercent }) } }