Skip to content

Commit 2ec905f

Browse files
author
Peter Bengtsson
authored
trailingCommas:all on prettier (#38888)
1 parent 3e6c8c2 commit 2ec905f

File tree

290 files changed

+908
-898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+908
-898
lines changed

.github/actions-scripts/check-for-enterprise-issues-by-label.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ async function run() {
1313
const queryRelease = encodeURIComponent('is:open repo:github/docs-content is:issue')
1414

1515
const deprecationIssues = await octokit.request(
16-
`GET /search/issues?q=${queryDeprecation}+label:"${encodeURI(ENTERPRISE_DEPRECATION_LABEL)}"`
16+
`GET /search/issues?q=${queryDeprecation}+label:"${encodeURI(ENTERPRISE_DEPRECATION_LABEL)}"`,
1717
)
1818
const releaseIssues = await octokit.request(
19-
`GET /search/issues?q=${queryRelease}+label:"${encodeURI(ENTERPRISE_RELEASE_LABEL)}"`
19+
`GET /search/issues?q=${queryRelease}+label:"${encodeURI(ENTERPRISE_RELEASE_LABEL)}"`,
2020
)
2121
const isDeprecationIssue = deprecationIssues.data.items.length === 0 ? 'false' : 'true'
2222
const isReleaseIssue = releaseIssues.data.items.length === 0 ? 'false' : 'true'
@@ -32,5 +32,5 @@ run().then(
3232
(error) => {
3333
console.log(`#ERROR# ${error}`)
3434
process.exit(1)
35-
}
35+
},
3636
)

.github/actions-scripts/content-changes-table-comment.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async function main(owner, repo, baseSHA, headSHA) {
6363

6464
const pathPrefix = 'content/'
6565
const articleFiles = files.filter(
66-
({ filename }) => filename.startsWith(pathPrefix) && filename.toLowerCase() !== 'readme.md'
66+
({ filename }) => filename.startsWith(pathPrefix) && filename.toLowerCase() !== 'readme.md',
6767
)
6868

6969
const lines = await Promise.all(
@@ -82,7 +82,7 @@ async function main(owner, repo, baseSHA, headSHA) {
8282
// So, to be able to get necessary meta data about what it *was*,
8383
// if it was removed, fall back to the 'base'.
8484
file.status === 'removed' ? baseSHA : headSHA,
85-
file.filename
85+
file.filename,
8686
)
8787

8888
// parse the frontmatter
@@ -108,7 +108,7 @@ async function main(owner, repo, baseSHA, headSHA) {
108108

109109
// walk by the plan names since we generate links differently for most plans
110110
const versions = fileVersions.filter((fileVersion) =>
111-
fileVersion.includes(allVersionShortnames[plan])
111+
fileVersion.includes(allVersionShortnames[plan]),
112112
)
113113

114114
if (versions.length === 1) {
@@ -141,7 +141,7 @@ async function main(owner, repo, baseSHA, headSHA) {
141141
}
142142
} catch (e) {
143143
console.error(
144-
`Version information for ${file.filename} couldn't be determined from its frontmatter.`
144+
`Version information for ${file.filename} couldn't be determined from its frontmatter.`,
145145
)
146146
}
147147
let note = ''
@@ -153,7 +153,7 @@ async function main(owner, repo, baseSHA, headSHA) {
153153
}
154154

155155
return `| ${contentCell} | ${previewCell} | ${prodCell} | ${note} |`
156-
})
156+
}),
157157
)
158158

159159
// this section limits the size of the comment

.github/actions-scripts/create-enterprise-issue.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from 'path'
55
import { getOctokit } from '@actions/github'
66
import { latest, oldestSupported } from '../../lib/enterprise-server-releases.js'
77
const enterpriseDates = JSON.parse(
8-
await fs.readFile(path.join(process.cwd(), 'src/ghes-releases/lib/enterprise-dates.json'))
8+
await fs.readFile(path.join(process.cwd(), 'src/ghes-releases/lib/enterprise-dates.json')),
99
)
1010

1111
const acceptedMilestones = ['release', 'deprecation']
@@ -54,7 +54,7 @@ async function run() {
5454

5555
if (!versionNumber) {
5656
console.log(
57-
`Could not find the next version number after ${latest} in enterprise-dates.json. Try running src/ghes-releases/scripts/update-enterprise-dates.js, then rerun this script.`
57+
`Could not find the next version number after ${latest} in enterprise-dates.json. Try running src/ghes-releases/scripts/update-enterprise-dates.js, then rerun this script.`,
5858
)
5959
process.exit(0)
6060
}
@@ -63,7 +63,7 @@ async function run() {
6363

6464
if (!datesForVersion) {
6565
console.log(
66-
`Could not find ${versionNumber} in enterprise-dates.json. Try running src/ghes-releases/scripts/update-enterprise-dates.js, then rerun this script.`
66+
`Could not find ${versionNumber} in enterprise-dates.json. Try running src/ghes-releases/scripts/update-enterprise-dates.js, then rerun this script.`,
6767
)
6868
process.exit(0)
6969
}
@@ -74,14 +74,14 @@ async function run() {
7474
// If the milestone is more than the specific days away, exit now.
7575
if (daysUntilMilestone > numberOfdaysBeforeMilestoneToOpenIssue) {
7676
console.log(
77-
`The ${versionNumber} ${milestone} is not until ${nextMilestoneDate}! An issue will be opened when it is ${numberOfdaysBeforeMilestoneToOpenIssue} days away.`
77+
`The ${versionNumber} ${milestone} is not until ${nextMilestoneDate}! An issue will be opened when it is ${numberOfdaysBeforeMilestoneToOpenIssue} days away.`,
7878
)
7979
process.exit(0)
8080
}
8181

8282
const milestoneSteps = await fs.readFile(
8383
path.join(process.cwd(), `src/ghes-releases/lib/${milestone}-steps.md`),
84-
'utf8'
84+
'utf8',
8585
)
8686
const issueLabels =
8787
milestone === 'release'
@@ -109,7 +109,7 @@ async function run() {
109109
if (issue.status === 201) {
110110
// Write the values to disk for use in the workflow.
111111
console.log(
112-
`Issue #${issue.data.number} for the ${versionNumber} ${milestone} was opened: ${issue.data.html_url}`
112+
`Issue #${issue.data.number} for the ${versionNumber} ${milestone} was opened: ${issue.data.html_url}`,
113113
)
114114
}
115115
} catch (error) {
@@ -137,7 +137,7 @@ async function run() {
137137
if (addCard.status === 201) {
138138
// Write the values to disk for use in the workflow.
139139
console.log(
140-
`The issue #${issue.data.number} was added to https://github.com/orgs/github/projects/1773#column-12198119.`
140+
`The issue #${issue.data.number} was added to https://github.com/orgs/github/projects/1773#column-12198119.`,
141141
)
142142
}
143143
} catch (error) {

.github/actions-scripts/enable-automerge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async function main() {
4242
if (graph.errors && graph.errors.length > 0) {
4343
console.error(
4444
'ERROR! Failed to enable auto-merge:\n - ' +
45-
graph.errors.map((error) => error.message).join('\n - ')
45+
graph.errors.map((error) => error.message).join('\n - '),
4646
)
4747
} else {
4848
console.log('Auto-merge enabled!')

.github/actions-scripts/fr-add-docs-reviewers-requests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async function getAllOpenPRs() {
5959
headers: {
6060
authorization: `token ${process.env.TOKEN}`,
6161
},
62-
}
62+
},
6363
)
6464

6565
prsRemaining = data.repository.pullRequests.pageInfo.hasPreviousPage
@@ -84,11 +84,11 @@ async function run() {
8484
!pr.isDraft &&
8585
!pr.labels.nodes.find((label) => label.name === 'Deploy train 🚂') &&
8686
pr.reviewRequests.nodes.find(
87-
(requestedReviewers) => requestedReviewers.requestedReviewer?.name === process.env.REVIEWER
87+
(requestedReviewers) => requestedReviewers.requestedReviewer?.name === process.env.REVIEWER,
8888
) &&
8989
!pr.reviews.nodes
9090
.flatMap((review) => review.onBehalfOf.nodes)
91-
.find((behalf) => behalf.name === process.env.REVIEWER)
91+
.find((behalf) => behalf.name === process.env.REVIEWER),
9292
)
9393
if (prs.length === 0) {
9494
console.log('No PRs found. Exiting.')
@@ -137,7 +137,7 @@ async function run() {
137137
headers: {
138138
authorization: `token ${process.env.TOKEN}`,
139139
},
140-
}
140+
},
141141
)
142142

143143
// Get the project ID

.github/actions-scripts/lib/debug-time-taken.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function debugTimeStart(core, instanceName) {
1414
export function debugTimeEnd(core, instanceName) {
1515
if (!timeInstances.has(instanceName)) {
1616
core.warn(
17-
`Invalid instanceName: ${instanceName} in debugTimeEnd. Did you call debugTimeStart first with the same instanceName?`
17+
`Invalid instanceName: ${instanceName} in debugTimeEnd. Did you call debugTimeStart first with the same instanceName?`,
1818
)
1919
return
2020
}

.github/actions-scripts/lib/get-env-inputs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function getEnvInputs(options) {
1313
throw new Error(`You must supply a ${envVarName} environment variable`)
1414
}
1515
return [envVarName, envVarValue]
16-
})
16+
}),
1717
)
1818
}
1919

.github/actions-scripts/projects.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function findSingleSelectID(singleSelectName, fieldName, data) {
2626
return singleSelect.id
2727
} else {
2828
throw new Error(
29-
`A single select called "${singleSelectName}" for the field "${fieldName}" was not found. Check if the single select was renamed.`
29+
`A single select called "${singleSelectName}" for the field "${fieldName}" was not found. Check if the single select was renamed.`,
3030
)
3131
}
3232
}
@@ -47,7 +47,7 @@ export async function addItemsToProject(items, project) {
4747
id
4848
}
4949
}
50-
`
50+
`,
5151
)
5252

5353
const mutation = `
@@ -102,7 +102,7 @@ export async function isDocsTeamMember(login) {
102102
headers: {
103103
authorization: `token ${process.env.TOKEN}`,
104104
},
105-
}
105+
},
106106
)
107107

108108
const teamMembers = data.organization.team.members.nodes.map((entry) => entry.login)
@@ -127,7 +127,7 @@ export async function isGitHubOrgMember(login) {
127127
headers: {
128128
authorization: `token ${process.env.TOKEN}`,
129129
},
130-
}
130+
},
131131
)
132132

133133
return Boolean(data.user.organization)
@@ -188,7 +188,7 @@ export function generateUpdateProjectV2ItemFieldMutation({
188188
return `
189189
set_${fieldID.slice(1)}_item_${item.replaceAll(
190190
/[^a-z0-9]/g,
191-
''
191+
'',
192192
)}: updateProjectV2ItemFieldValue(input: {
193193
projectId: $project
194194
itemId: "${item}"

.github/actions-scripts/purge-fastly-edge-cache-per-language.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const languages = process.env.LANGUAGES
3636

3737
for (const language of languages) {
3838
console.log(
39-
`Sleeping ${DELAY_BETWEEN_LANGUAGES / 1000} seconds before purging for '${language}'...`
39+
`Sleeping ${DELAY_BETWEEN_LANGUAGES / 1000} seconds before purging for '${language}'...`,
4040
)
4141
await sleep(DELAY_BETWEEN_LANGUAGES)
4242
await purgeEdgeCache(makeLanguageSurrogateKey(language))
@@ -49,7 +49,7 @@ function languagesFromString(str) {
4949
.filter(Boolean)
5050
if (!languages.every((lang) => languageKeys.includes(lang))) {
5151
throw new Error(
52-
`Unrecognized language code (${languages.find((lang) => !languageKeys.includes(lang))})`
52+
`Unrecognized language code (${languages.find((lang) => !languageKeys.includes(lang))})`,
5353
)
5454
}
5555
return languages

.github/actions-scripts/ready-for-docs-review.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async function run() {
5656
headers: {
5757
authorization: `token ${process.env.TOKEN}`,
5858
},
59-
}
59+
},
6060
)
6161

6262
// Get the project ID
@@ -156,17 +156,17 @@ async function run() {
156156
headers: {
157157
authorization: `token ${process.env.TOKEN}`,
158158
},
159-
}
159+
},
160160
)
161161
const docsPRData =
162162
contributorData.user.contributionsCollection.pullRequestContributionsByRepository.filter(
163-
(item) => item.repository.nameWithOwner === 'github/docs'
163+
(item) => item.repository.nameWithOwner === 'github/docs',
164164
)[0]
165165
const prCount = docsPRData ? docsPRData.contributions.totalCount : 0
166166

167167
const docsIssueData =
168168
contributorData.user.contributionsCollection.issueContributionsByRepository.filter(
169-
(item) => item.repository.nameWithOwner === 'github/docs'
169+
(item) => item.repository.nameWithOwner === 'github/docs',
170170
)[0]
171171
const issueCount = docsIssueData ? docsIssueData.contributions.totalCount : 0
172172

0 commit comments

Comments
 (0)