Enforce use of template literals (#2242)

This is consistent with what we're pretty much already doing, and saves us from making the request during code review.

These were all autofixed and most of them seem easier to read. Some in the legacy services should be rewritten in more legible forms during refactor (ie using intermediate variables, or using request’s qs option). There are some in helper functions and elsewhere that should get rewritten separately. I don't want to change them in this PR because the changes will get lost in this diff, though we could identify them here and fix them before or just after.
This commit is contained in:
Paul Melnikow
2018-11-02 17:11:44 -04:00
committed by GitHub
parent 4a298cbcb0
commit 83ac6ff1b3
120 changed files with 305 additions and 443 deletions

View File

@@ -30,12 +30,12 @@ module.exports = class Jitpack extends LegacyService {
camp.route(
/^\/jitpack\/v\/([^/]*)\/([^/]*)\.(svg|png|gif|jpg|json)$/,
cache((data, match, sendBadge, request) => {
const groupId = 'com.github.' + match[1] // github user
const groupId = `com.github.${match[1]}` // github user
const artifactId = match[2] // the project's name
const format = match[3] // "svg"
const pkg = groupId + '/' + artifactId + '/latest'
const apiUrl = 'https://jitpack.io/api/builds/' + pkg
const pkg = `${groupId}/${artifactId}/latest`
const apiUrl = `https://jitpack.io/api/builds/${pkg}`
const badgeData = getBadgeData('jitpack', data)