Skip to content

Commit

Permalink
chore: fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed Nov 6, 2021
1 parent bec6fef commit 376b376
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
17 changes: 7 additions & 10 deletions services/gitlab/gitlab-coverage.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}` : ''
Expand All @@ -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 }),
Expand Down
4 changes: 2 additions & 2 deletions services/ore/ore-sponge-versions.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions services/ore/ore-version.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
4 changes: 2 additions & 2 deletions services/steam/steam-workshop.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
}

Expand Down
1 change: 1 addition & 0 deletions services/text-formatters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
}

0 comments on commit 376b376

Please sign in to comment.