diff --git a/.github/actions-scripts/check-for-enterprise-issues-by-label.js b/.github/actions-scripts/check-for-enterprise-issues-by-label.js index 6cf651480368..4c9ba8475c30 100755 --- a/.github/actions-scripts/check-for-enterprise-issues-by-label.js +++ b/.github/actions-scripts/check-for-enterprise-issues-by-label.js @@ -13,10 +13,10 @@ async function run() { const queryRelease = encodeURIComponent('is:open repo:github/docs-content is:issue') const deprecationIssues = await octokit.request( - `GET /search/issues?q=${queryDeprecation}+label:"${encodeURI(ENTERPRISE_DEPRECATION_LABEL)}"` + `GET /search/issues?q=${queryDeprecation}+label:"${encodeURI(ENTERPRISE_DEPRECATION_LABEL)}"`, ) const releaseIssues = await octokit.request( - `GET /search/issues?q=${queryRelease}+label:"${encodeURI(ENTERPRISE_RELEASE_LABEL)}"` + `GET /search/issues?q=${queryRelease}+label:"${encodeURI(ENTERPRISE_RELEASE_LABEL)}"`, ) const isDeprecationIssue = deprecationIssues.data.items.length === 0 ? 'false' : 'true' const isReleaseIssue = releaseIssues.data.items.length === 0 ? 'false' : 'true' @@ -32,5 +32,5 @@ run().then( (error) => { console.log(`#ERROR# ${error}`) process.exit(1) - } + }, ) diff --git a/.github/actions-scripts/content-changes-table-comment.js b/.github/actions-scripts/content-changes-table-comment.js index 920c1dca9ff1..1648f934d569 100755 --- a/.github/actions-scripts/content-changes-table-comment.js +++ b/.github/actions-scripts/content-changes-table-comment.js @@ -63,7 +63,7 @@ async function main(owner, repo, baseSHA, headSHA) { const pathPrefix = 'content/' const articleFiles = files.filter( - ({ filename }) => filename.startsWith(pathPrefix) && filename.toLowerCase() !== 'readme.md' + ({ filename }) => filename.startsWith(pathPrefix) && filename.toLowerCase() !== 'readme.md', ) const lines = await Promise.all( @@ -82,7 +82,7 @@ async function main(owner, repo, baseSHA, headSHA) { // So, to be able to get necessary meta data about what it *was*, // if it was removed, fall back to the 'base'. file.status === 'removed' ? baseSHA : headSHA, - file.filename + file.filename, ) // parse the frontmatter @@ -108,7 +108,7 @@ async function main(owner, repo, baseSHA, headSHA) { // walk by the plan names since we generate links differently for most plans const versions = fileVersions.filter((fileVersion) => - fileVersion.includes(allVersionShortnames[plan]) + fileVersion.includes(allVersionShortnames[plan]), ) if (versions.length === 1) { @@ -141,7 +141,7 @@ async function main(owner, repo, baseSHA, headSHA) { } } catch (e) { console.error( - `Version information for ${file.filename} couldn't be determined from its frontmatter.` + `Version information for ${file.filename} couldn't be determined from its frontmatter.`, ) } let note = '' @@ -153,7 +153,7 @@ async function main(owner, repo, baseSHA, headSHA) { } return `| ${contentCell} | ${previewCell} | ${prodCell} | ${note} |` - }) + }), ) // this section limits the size of the comment diff --git a/.github/actions-scripts/create-enterprise-issue.js b/.github/actions-scripts/create-enterprise-issue.js index 07b94935370b..36e71d6a326e 100755 --- a/.github/actions-scripts/create-enterprise-issue.js +++ b/.github/actions-scripts/create-enterprise-issue.js @@ -5,7 +5,7 @@ import path from 'path' import { getOctokit } from '@actions/github' import { latest, oldestSupported } from '../../lib/enterprise-server-releases.js' const enterpriseDates = JSON.parse( - await fs.readFile(path.join(process.cwd(), 'src/ghes-releases/lib/enterprise-dates.json')) + await fs.readFile(path.join(process.cwd(), 'src/ghes-releases/lib/enterprise-dates.json')), ) const acceptedMilestones = ['release', 'deprecation'] @@ -54,7 +54,7 @@ async function run() { if (!versionNumber) { console.log( - `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.` + `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.`, ) process.exit(0) } @@ -63,7 +63,7 @@ async function run() { if (!datesForVersion) { console.log( - `Could not find ${versionNumber} in enterprise-dates.json. Try running src/ghes-releases/scripts/update-enterprise-dates.js, then rerun this script.` + `Could not find ${versionNumber} in enterprise-dates.json. Try running src/ghes-releases/scripts/update-enterprise-dates.js, then rerun this script.`, ) process.exit(0) } @@ -74,14 +74,14 @@ async function run() { // If the milestone is more than the specific days away, exit now. if (daysUntilMilestone > numberOfdaysBeforeMilestoneToOpenIssue) { console.log( - `The ${versionNumber} ${milestone} is not until ${nextMilestoneDate}! An issue will be opened when it is ${numberOfdaysBeforeMilestoneToOpenIssue} days away.` + `The ${versionNumber} ${milestone} is not until ${nextMilestoneDate}! An issue will be opened when it is ${numberOfdaysBeforeMilestoneToOpenIssue} days away.`, ) process.exit(0) } const milestoneSteps = await fs.readFile( path.join(process.cwd(), `src/ghes-releases/lib/${milestone}-steps.md`), - 'utf8' + 'utf8', ) const issueLabels = milestone === 'release' @@ -109,7 +109,7 @@ async function run() { if (issue.status === 201) { // Write the values to disk for use in the workflow. console.log( - `Issue #${issue.data.number} for the ${versionNumber} ${milestone} was opened: ${issue.data.html_url}` + `Issue #${issue.data.number} for the ${versionNumber} ${milestone} was opened: ${issue.data.html_url}`, ) } } catch (error) { @@ -137,7 +137,7 @@ async function run() { if (addCard.status === 201) { // Write the values to disk for use in the workflow. console.log( - `The issue #${issue.data.number} was added to https://github.com/orgs/github/projects/1773#column-12198119.` + `The issue #${issue.data.number} was added to https://github.com/orgs/github/projects/1773#column-12198119.`, ) } } catch (error) { diff --git a/.github/actions-scripts/enable-automerge.js b/.github/actions-scripts/enable-automerge.js index cb4f02f782cd..0005e031d545 100644 --- a/.github/actions-scripts/enable-automerge.js +++ b/.github/actions-scripts/enable-automerge.js @@ -42,7 +42,7 @@ async function main() { if (graph.errors && graph.errors.length > 0) { console.error( 'ERROR! Failed to enable auto-merge:\n - ' + - graph.errors.map((error) => error.message).join('\n - ') + graph.errors.map((error) => error.message).join('\n - '), ) } else { console.log('Auto-merge enabled!') diff --git a/.github/actions-scripts/fr-add-docs-reviewers-requests.js b/.github/actions-scripts/fr-add-docs-reviewers-requests.js index ec31eaf529d1..2e5505093968 100644 --- a/.github/actions-scripts/fr-add-docs-reviewers-requests.js +++ b/.github/actions-scripts/fr-add-docs-reviewers-requests.js @@ -59,7 +59,7 @@ async function getAllOpenPRs() { headers: { authorization: `token ${process.env.TOKEN}`, }, - } + }, ) prsRemaining = data.repository.pullRequests.pageInfo.hasPreviousPage @@ -84,11 +84,11 @@ async function run() { !pr.isDraft && !pr.labels.nodes.find((label) => label.name === 'Deploy train 🚂') && pr.reviewRequests.nodes.find( - (requestedReviewers) => requestedReviewers.requestedReviewer?.name === process.env.REVIEWER + (requestedReviewers) => requestedReviewers.requestedReviewer?.name === process.env.REVIEWER, ) && !pr.reviews.nodes .flatMap((review) => review.onBehalfOf.nodes) - .find((behalf) => behalf.name === process.env.REVIEWER) + .find((behalf) => behalf.name === process.env.REVIEWER), ) if (prs.length === 0) { console.log('No PRs found. Exiting.') @@ -137,7 +137,7 @@ async function run() { headers: { authorization: `token ${process.env.TOKEN}`, }, - } + }, ) // Get the project ID diff --git a/.github/actions-scripts/lib/debug-time-taken.js b/.github/actions-scripts/lib/debug-time-taken.js index bfd484ea1fe7..a3cf69daceb1 100644 --- a/.github/actions-scripts/lib/debug-time-taken.js +++ b/.github/actions-scripts/lib/debug-time-taken.js @@ -14,7 +14,7 @@ export function debugTimeStart(core, instanceName) { export function debugTimeEnd(core, instanceName) { if (!timeInstances.has(instanceName)) { core.warn( - `Invalid instanceName: ${instanceName} in debugTimeEnd. Did you call debugTimeStart first with the same instanceName?` + `Invalid instanceName: ${instanceName} in debugTimeEnd. Did you call debugTimeStart first with the same instanceName?`, ) return } diff --git a/.github/actions-scripts/lib/get-env-inputs.js b/.github/actions-scripts/lib/get-env-inputs.js index df1558d8fc04..5d6779bb9704 100644 --- a/.github/actions-scripts/lib/get-env-inputs.js +++ b/.github/actions-scripts/lib/get-env-inputs.js @@ -13,7 +13,7 @@ export function getEnvInputs(options) { throw new Error(`You must supply a ${envVarName} environment variable`) } return [envVarName, envVarValue] - }) + }), ) } diff --git a/.github/actions-scripts/projects.js b/.github/actions-scripts/projects.js index 87887363c7a0..6c4fc785a9fa 100644 --- a/.github/actions-scripts/projects.js +++ b/.github/actions-scripts/projects.js @@ -26,7 +26,7 @@ export function findSingleSelectID(singleSelectName, fieldName, data) { return singleSelect.id } else { throw new Error( - `A single select called "${singleSelectName}" for the field "${fieldName}" was not found. Check if the single select was renamed.` + `A single select called "${singleSelectName}" for the field "${fieldName}" was not found. Check if the single select was renamed.`, ) } } @@ -47,7 +47,7 @@ export async function addItemsToProject(items, project) { id } } - ` + `, ) const mutation = ` @@ -102,7 +102,7 @@ export async function isDocsTeamMember(login) { headers: { authorization: `token ${process.env.TOKEN}`, }, - } + }, ) const teamMembers = data.organization.team.members.nodes.map((entry) => entry.login) @@ -127,7 +127,7 @@ export async function isGitHubOrgMember(login) { headers: { authorization: `token ${process.env.TOKEN}`, }, - } + }, ) return Boolean(data.user.organization) @@ -188,7 +188,7 @@ export function generateUpdateProjectV2ItemFieldMutation({ return ` set_${fieldID.slice(1)}_item_${item.replaceAll( /[^a-z0-9]/g, - '' + '', )}: updateProjectV2ItemFieldValue(input: { projectId: $project itemId: "${item}" diff --git a/.github/actions-scripts/purge-fastly-edge-cache-per-language.js b/.github/actions-scripts/purge-fastly-edge-cache-per-language.js index 6f540b468fa9..655180b0b6fe 100755 --- a/.github/actions-scripts/purge-fastly-edge-cache-per-language.js +++ b/.github/actions-scripts/purge-fastly-edge-cache-per-language.js @@ -36,7 +36,7 @@ const languages = process.env.LANGUAGES for (const language of languages) { console.log( - `Sleeping ${DELAY_BETWEEN_LANGUAGES / 1000} seconds before purging for '${language}'...` + `Sleeping ${DELAY_BETWEEN_LANGUAGES / 1000} seconds before purging for '${language}'...`, ) await sleep(DELAY_BETWEEN_LANGUAGES) await purgeEdgeCache(makeLanguageSurrogateKey(language)) @@ -49,7 +49,7 @@ function languagesFromString(str) { .filter(Boolean) if (!languages.every((lang) => languageKeys.includes(lang))) { throw new Error( - `Unrecognized language code (${languages.find((lang) => !languageKeys.includes(lang))})` + `Unrecognized language code (${languages.find((lang) => !languageKeys.includes(lang))})`, ) } return languages diff --git a/.github/actions-scripts/ready-for-docs-review.js b/.github/actions-scripts/ready-for-docs-review.js index 4bfb7b1dfbe2..721837acd109 100644 --- a/.github/actions-scripts/ready-for-docs-review.js +++ b/.github/actions-scripts/ready-for-docs-review.js @@ -56,7 +56,7 @@ async function run() { headers: { authorization: `token ${process.env.TOKEN}`, }, - } + }, ) // Get the project ID @@ -156,17 +156,17 @@ async function run() { headers: { authorization: `token ${process.env.TOKEN}`, }, - } + }, ) const docsPRData = contributorData.user.contributionsCollection.pullRequestContributionsByRepository.filter( - (item) => item.repository.nameWithOwner === 'github/docs' + (item) => item.repository.nameWithOwner === 'github/docs', )[0] const prCount = docsPRData ? docsPRData.contributions.totalCount : 0 const docsIssueData = contributorData.user.contributionsCollection.issueContributionsByRepository.filter( - (item) => item.repository.nameWithOwner === 'github/docs' + (item) => item.repository.nameWithOwner === 'github/docs', )[0] const issueCount = docsIssueData ? docsIssueData.contributions.totalCount : 0 diff --git a/.github/actions-scripts/rendered-content-link-checker.js b/.github/actions-scripts/rendered-content-link-checker.js index 643197236eb4..586ef470b839 100755 --- a/.github/actions-scripts/rendered-content-link-checker.js +++ b/.github/actions-scripts/rendered-content-link-checker.js @@ -73,7 +73,7 @@ const linksToSkip = linksToSkipFactory(excludedLinks) const CONTENT_ROOT = path.resolve('content') const deprecatedVersionPrefixesRegex = new RegExp( - `enterprise(-server@|/)(${deprecated.join('|')})(/|$)` + `enterprise(-server@|/)(${deprecated.join('|')})(/|$)`, ) // When this file is invoked directly from action as opposed to being imported @@ -228,7 +228,7 @@ async function main(core, octokit, uploadArtifact, opts = {}) { if (checkExternalLinks && pages.length >= 100) { core.warning( - `Warning! Checking external URLs can be time costly. You're testing ${pages.length} pages.` + `Warning! Checking external URLs can be time costly. You're testing ${pages.length} pages.`, ) } @@ -238,8 +238,8 @@ async function main(core, octokit, uploadArtifact, opts = {}) { const t0 = new Date().getTime() const flawsGroups = await Promise.all( pages.map((page) => - processPage(core, page, pageMap, redirects, opts, externalLinkCheckerDB, versions) - ) + processPage(core, page, pageMap, redirects, opts, externalLinkCheckerDB, versions), + ), ) const t1 = new Date().getTime() debugTimeEnd(core, 'processPages') @@ -283,7 +283,7 @@ async function main(core, octokit, uploadArtifact, opts = {}) { core.setOutput('has_flaws_at_level', flawsInLevel.length > 0) if (failOnFlaw) { core.setFailed( - `${flaws.length + 1} broken links found. See action artifact uploads for details` + `${flaws.length + 1} broken links found. See action artifact uploads for details`, ) } } @@ -395,7 +395,7 @@ async function linkReports(core, octokit, newReport, opts) { body, }) core.info( - `Linked old report to new report via comment on old report: #${previousReport.number}.` + `Linked old report to new report via comment on old report: #${previousReport.number}.`, ) } catch (error) { core.setFailed(`Error commenting on previousReport, #${previousReport.number}`) @@ -566,7 +566,7 @@ function printGlobalCacheHitRatio(core) { `Cache hit ratio: ${hits.toLocaleString()} of ${(misses + hits).toLocaleString()} (${( (100 * hits) / (misses + hits) - ).toFixed(1)}%)` + ).toFixed(1)}%)`, ) } } @@ -619,7 +619,7 @@ async function processPage(core, page, pageMap, redirects, opts, db, versions) { }) .map((permalink) => { return processPermalink(core, permalink, page, pageMap, redirects, opts, db) - }) + }), ) const allFlaws = allFlawsEach.flat() @@ -687,7 +687,7 @@ async function processPermalink(core, permalink, page, pageMap, redirects, opts, checkExternalLinks, externalServerErrorsAsWarning, { verbose, patient }, - db + db, ) if (flaw) { @@ -704,7 +704,7 @@ async function processPermalink(core, permalink, page, pageMap, redirects, opts, globalHrefCheckCache.set(href, flaw) } } - }) + }), ) for (const flaw of newFlaws) { @@ -748,7 +748,7 @@ async function uploadJsonFlawsArtifact( uploadArtifact, flaws, { verboseUrl = null } = {}, - artifactName = 'all-rendered-link-flaws.json' + artifactName = 'all-rendered-link-flaws.json', ) { const printableFlaws = {} for (const { page, permalink, href, text, src, flaw } of flaws) { @@ -833,7 +833,7 @@ async function checkHrefLink( checkExternalLinks = false, externalServerErrorsAsWarning = false, { verbose = false, patient = false } = {}, - db = null + db = null, ) { if (href === '#') { if (checkAnchors) { @@ -883,7 +883,7 @@ async function checkHrefLink( if (pathname.split('/')[1] in STATIC_PREFIXES) { const staticFilePath = path.join( STATIC_PREFIXES[pathname.split('/')[1]], - pathname.split(path.sep).slice(2).join(path.sep) + pathname.split(path.sep).slice(2).join(path.sep), ) if (!fs.existsSync(staticFilePath)) { return { CRITICAL: `Static file not found ${staticFilePath} (${pathname})` } @@ -1045,7 +1045,7 @@ async function innerFetch(core, url, config = {}) { }) if (verbose) { core.info( - `External URL ${useGET ? 'GET' : 'HEAD'} ${url}: ${r.statusCode} (retries: ${retries})` + `External URL ${useGET ? 'GET' : 'HEAD'} ${url}: ${r.statusCode} (retries: ${retries})`, ) } @@ -1055,7 +1055,7 @@ async function innerFetch(core, url, config = {}) { if (r.statusCode === 429) { let sleepTime = Math.min( 60_000, - Math.max(10_000, getRetryAfterSleep(r.headers['retry-after'])) + Math.max(10_000, getRetryAfterSleep(r.headers['retry-after'])), ) // Sprinkle a little jitter so it doesn't all start again all // at the same time @@ -1067,8 +1067,8 @@ async function innerFetch(core, url, config = {}) { if (verbose) core.info( chalk.yellow( - `Rate limited on ${hostname} (${url}). Sleeping for ${(sleepTime / 1000).toFixed(1)}s` - ) + `Rate limited on ${hostname} (${url}). Sleeping for ${(sleepTime / 1000).toFixed(1)}s`, + ), ) await sleep(sleepTime) return innerFetch(core, url, Object.assign({}, config, { retries: retries + 1 })) @@ -1115,7 +1115,7 @@ function checkImageSrc(src, $) { if (prefix in STATIC_PREFIXES) { const staticFilePath = path.join( STATIC_PREFIXES[prefix], - pathname.split(path.sep).slice(2).join(path.sep) + pathname.split(path.sep).slice(2).join(path.sep), ) if (!fs.existsSync(staticFilePath)) { return { CRITICAL: `Static file not found (${pathname})` } @@ -1129,8 +1129,8 @@ function summarizeFlaws(core, flaws) { if (flaws.length) { core.info( chalk.bold( - `Found ${flaws.length.toLocaleString()} flaw${flaws.length === 1 ? '' : 's'} in total.` - ) + `Found ${flaws.length.toLocaleString()} flaw${flaws.length === 1 ? '' : 's'} in total.`, + ), ) } else { core.info(chalk.green('No flaws found! 💖')) @@ -1140,7 +1140,7 @@ function summarizeFlaws(core, flaws) { function summarizeCounts(core, pages, tookSeconds) { const count = pages.map((page) => page.permalinks.length).reduce((a, b) => a + b, 0) core.info( - `Tested ${count.toLocaleString()} permalinks across ${pages.length.toLocaleString()} pages` + `Tested ${count.toLocaleString()} permalinks across ${pages.length.toLocaleString()} pages`, ) core.info(`Took ${Math.floor(tookSeconds)} seconds. (~${(tookSeconds / 60).toFixed(1)} minutes)`) const permalinksPerSecond = count / tookSeconds diff --git a/.prettierrc.json b/.prettierrc.json index 83779fed66d3..6223ec288b56 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -11,8 +11,7 @@ "options": { "semi": false, "singleQuote": true, - "printWidth": 100, - "trailingComma": "es5" + "printWidth": 100 } } ] diff --git a/components/ClientSideHighlightJS.tsx b/components/ClientSideHighlightJS.tsx index c5b7bab28272..67a1b15d03b1 100644 --- a/components/ClientSideHighlightJS.tsx +++ b/components/ClientSideHighlightJS.tsx @@ -50,13 +50,13 @@ export default function ClientSideHighlightJS() { } }) for (const parent of Array.from( - document.querySelectorAll(CODE_ELEMENTS_PARENT_SELECTOR) + document.querySelectorAll(CODE_ELEMENTS_PARENT_SELECTOR), )) { const language = parent.dataset.highlight || 'json' if (!SUPPORTED_LANGUAGES.includes(language)) { if (process.env.NODE_ENV === 'development') { console.warn( - `For highlighting, only ${SUPPORTED_LANGUAGES} is supported. Not '${language}'.` + `For highlighting, only ${SUPPORTED_LANGUAGES} is supported. Not '${language}'.`, ) } continue diff --git a/components/ClientSideRefresh.tsx b/components/ClientSideRefresh.tsx index 156c68c8273d..a4e5838054c3 100644 --- a/components/ClientSideRefresh.tsx +++ b/components/ClientSideRefresh.tsx @@ -30,7 +30,7 @@ export default function ClientSideRefresh() { // because, naturally, the first time you mount it, it will not // need to refresh because it's as fresh as it gets already. revalidateOnMount: false, - } + }, ) return null diff --git a/components/LinkPreviewPopover.tsx b/components/LinkPreviewPopover.tsx index e4f0ca4808d3..d61ce4d75a7a 100644 --- a/components/LinkPreviewPopover.tsx +++ b/components/LinkPreviewPopover.tsx @@ -58,7 +58,7 @@ function getOrCreatePopoverGlobal() { // or 'Popover-message--top-right`. These get set later when we // know where the popover message should appear on the screen. inner.classList.add( - ...'Popover-message Popover-message--large p-3 Box color-shadow-large'.split(/\s+/g) + ...'Popover-message Popover-message--large p-3 Box color-shadow-large'.split(/\s+/g), ) inner.style.width = `360px` @@ -343,8 +343,8 @@ export function LinkPreviewPopover() { const links = Array.from( document.querySelectorAll( - '#article-contents a[href], #article-intro a[href]' - ) + '#article-contents a[href], #article-intro a[href]', + ), ).filter((link) => { // This filters out links that are not internal or in-page // and the ones that are in-page anchor links next to the headings. diff --git a/components/article/PlatformPicker.tsx b/components/article/PlatformPicker.tsx index 3bed51dfcca1..24fe5acc722c 100644 --- a/components/article/PlatformPicker.tsx +++ b/components/article/PlatformPicker.tsx @@ -28,8 +28,8 @@ function showPlatformSpecificContent(platform: string) { // example: inline content const platformEls = Array.from( document.querySelectorAll( - platforms.map((platform) => `.platform-${platform.value}`).join(', ') - ) + platforms.map((platform) => `.platform-${platform.value}`).join(', '), + ), ) platformEls.forEach((el) => { el.style.display = el.classList.contains(`platform-${platform}`) ? '' : 'none' diff --git a/components/article/ToolPicker.tsx b/components/article/ToolPicker.tsx index 171865fb8e92..cb7bbd83a430 100644 --- a/components/article/ToolPicker.tsx +++ b/components/article/ToolPicker.tsx @@ -22,7 +22,9 @@ function showToolSpecificContent(tool: string, supportedTools: Array) { // find all tool-specific *inline* elements and hide or show as appropriate // example: inline content const toolEls = Array.from( - document.querySelectorAll(supportedTools.map((tool) => `.tool-${tool}`).join(', ')) + document.querySelectorAll( + supportedTools.map((tool) => `.tool-${tool}`).join(', '), + ), ) toolEls.forEach((el) => { el.style.display = el.classList.contains(`tool-${tool}`) ? '' : 'none' diff --git a/components/context/ArticleContext.tsx b/components/context/ArticleContext.tsx index 19d53b56003f..ce387939b634 100644 --- a/components/context/ArticleContext.tsx +++ b/components/context/ArticleContext.tsx @@ -66,7 +66,7 @@ export const getArticleContextFromRequest = (req: any): ArticleContextT => { if (page.effectiveDate) { if (isNaN(Date.parse(page.effectiveDate))) { throw new Error( - 'The "effectiveDate" frontmatter property is not valid. Please make sure it is YEAR-MONTH-DAY' + 'The "effectiveDate" frontmatter property is not valid. Please make sure it is YEAR-MONTH-DAY', ) } } diff --git a/components/context/MainContext.tsx b/components/context/MainContext.tsx index f677f54fda89..77f7da678576 100644 --- a/components/context/MainContext.tsx +++ b/components/context/MainContext.tsx @@ -148,13 +148,13 @@ export const getMainContext = async (req: any, res: any): Promise reusables: { enterprise_deprecation: { version_was_deprecated: req.context.getDottedData( - 'reusables.enterprise_deprecation.version_was_deprecated' + 'reusables.enterprise_deprecation.version_was_deprecated', ), version_will_be_deprecated: req.context.getDottedData( - 'reusables.enterprise_deprecation.version_will_be_deprecated' + 'reusables.enterprise_deprecation.version_will_be_deprecated', ), deprecation_details: req.context.getDottedData( - 'reusables.enterprise_deprecation.deprecation_details' + 'reusables.enterprise_deprecation.deprecation_details', ), }, policies: { @@ -179,7 +179,7 @@ export const getMainContext = async (req: any, res: any): Promise topics: req.context.page.topics || [], introPlainText: req.context.page?.introPlainText, permalinks: req.context.page?.permalinks.map((obj: any) => - pick(obj, ['title', 'pageVersion', 'href', 'relativePath', 'languageCode']) + pick(obj, ['title', 'pageVersion', 'href', 'relativePath', 'languageCode']), ), hidden: req.context.page.hidden || false, noEarlyAccessBanner: req.context.page.noEarlyAccessBanner || false, diff --git a/components/context/TocLandingContext.tsx b/components/context/TocLandingContext.tsx index 349ae5b063ae..1d13923506b7 100644 --- a/components/context/TocLandingContext.tsx +++ b/components/context/TocLandingContext.tsx @@ -41,7 +41,7 @@ export const getTocLandingContextFromRequest = (req: any): TocLandingContextT => productCallout: req.context.page.product || '', intro: req.context.page.intro, tocItems: (req.context.genericTocFlat || req.context.genericTocNested || []).map((obj: any) => - pick(obj, ['fullPath', 'title', 'intro', 'childTocItems']) + pick(obj, ['fullPath', 'title', 'intro', 'childTocItems']), ), variant: req.context.genericTocFlat ? 'expanded' : 'compact', diff --git a/components/hooks/useOnScreen.ts b/components/hooks/useOnScreen.ts index 196204858d82..d5bbdab51036 100644 --- a/components/hooks/useOnScreen.ts +++ b/components/hooks/useOnScreen.ts @@ -2,7 +2,7 @@ import { useState, useEffect, MutableRefObject, RefObject } from 'react' export function useOnScreen( ref: MutableRefObject | RefObject, - options?: IntersectionObserverInit + options?: IntersectionObserverInit, ): boolean { const [isIntersecting, setIntersecting] = useState(false) useEffect(() => { diff --git a/components/lib/copy-code.ts b/components/lib/copy-code.ts index b6a7ddefe78f..592904cca8e9 100644 --- a/components/lib/copy-code.ts +++ b/components/lib/copy-code.ts @@ -19,6 +19,6 @@ export default function copyCode() { setTimeout(() => { button.setAttribute('aria-label', beforeTooltip) }, 2000) - }) + }), ) } diff --git a/components/lib/scroll-anchoring.d.ts b/components/lib/scroll-anchoring.d.ts index c761556ec4bb..bbd6f2f00671 100644 --- a/components/lib/scroll-anchoring.d.ts +++ b/components/lib/scroll-anchoring.d.ts @@ -2,7 +2,7 @@ declare module 'scroll-anchoring' { export function findAnchorNode(document: Document): Node | undefined export function preserveAnchorNodePosition( document: Document, - callback: () => Promise | T + callback: () => Promise | T, ): Promise export function preservePosition(anchorNode: Node, callback: () => Promise | T): Promise } diff --git a/components/page-footer/LegalFooter.tsx b/components/page-footer/LegalFooter.tsx index af682a32e0d6..c251970f3bf8 100644 --- a/components/page-footer/LegalFooter.tsx +++ b/components/page-footer/LegalFooter.tsx @@ -42,7 +42,7 @@ export const LegalFooter = () => { legacyBehavior={false} className={cx( 'text-underline', - router.locale === 'ko' && 'color-fg-attention text-bold' + router.locale === 'ko' && 'color-fg-attention text-bold', )} > {t('privacy')} diff --git a/components/page-footer/SupportSection.tsx b/components/page-footer/SupportSection.tsx index 3276c55e5216..6d873b30b949 100644 --- a/components/page-footer/SupportSection.tsx +++ b/components/page-footer/SupportSection.tsx @@ -35,7 +35,7 @@ export const SupportSection = () => { className={cx( 'float-left pr-4 mb-6 mb-xl-0 col-12', totalCols > 1 && 'col-lg-6', - totalCols > 2 && 'col-xl-3' + totalCols > 2 && 'col-xl-3', )} > @@ -47,7 +47,7 @@ export const SupportSection = () => { 'float-left pr-4 mb-6 mb-xl-0 col-12', totalCols > 1 && 'col-lg-6', totalCols > 2 && 'col-xl-4', - totalCols > 2 && showSurvey && 'offset-xl-1' + totalCols > 2 && showSurvey && 'offset-xl-1', )} > @@ -59,7 +59,7 @@ export const SupportSection = () => { 'float-left pr-4 mb-6 mb-xl-0 col-12', totalCols > 1 && 'col-lg-6', totalCols > 2 && 'col-xl-3', - totalCols > 2 && (showSurvey || showContribution) && 'offset-xl-1' + totalCols > 2 && (showSurvey || showContribution) && 'offset-xl-1', )} > diff --git a/components/page-header/Breadcrumbs.tsx b/components/page-header/Breadcrumbs.tsx index 14ad14e10c41..9182d14f2d0f 100644 --- a/components/page-header/Breadcrumbs.tsx +++ b/components/page-header/Breadcrumbs.tsx @@ -49,7 +49,7 @@ export const Breadcrumbs = ({ inHeader }: Props) => { 'Link--primary mr-2 color-fg-muted', // Show the last breadcrumb if it's in the header, but not if it's in the article // If there's only 1 breadcrumb, show it - !inHeader && i === arr.length - 1 && arr.length !== 1 && 'd-none' + !inHeader && i === arr.length - 1 && arr.length !== 1 && 'd-none', )} > {breadcrumb.title} diff --git a/components/page-header/Header.tsx b/components/page-header/Header.tsx index 1c8b4c9aa4b8..553180f3dfa5 100644 --- a/components/page-header/Header.tsx +++ b/components/page-header/Header.tsx @@ -126,14 +126,14 @@ export const Header = () => {
{error !== '404' && }
{ isSearchOpen ? styles.searchContainerWithOpenSearch : styles.searchContainerWithClosedSearch, - 'mr-3' + 'mr-3', )} > @@ -194,7 +194,7 @@ export const Header = () => { setIsSearchOpen(!isSearchOpen)} diff --git a/components/page-header/HeaderNotifications.tsx b/components/page-header/HeaderNotifications.tsx index 42c0621a1e21..7eba342c1a29 100644 --- a/components/page-header/HeaderNotifications.tsx +++ b/components/page-header/HeaderNotifications.tsx @@ -89,7 +89,7 @@ export const HeaderNotifications = () => { type === NotificationType.TRANSLATION && 'color-bg-accent', type === NotificationType.RELEASE && 'color-bg-accent', type === NotificationType.EARLY_ACCESS && 'color-bg-danger', - !isLast && 'border-bottom color-border-default' + !isLast && 'border-bottom color-border-default', )} dangerouslySetInnerHTML={{ __html: content }} /> diff --git a/components/page-header/VersionPicker.tsx b/components/page-header/VersionPicker.tsx index eafdc1e4bc50..042c820d4777 100644 --- a/components/page-header/VersionPicker.tsx +++ b/components/page-header/VersionPicker.tsx @@ -38,7 +38,7 @@ export const VersionPicker = ({ mediumOrLower }: Props) => { })) const hasEnterpriseVersions = (page.permalinks || []).some((permalink) => - permalink.pageVersion.startsWith('enterprise-server') + permalink.pageVersion.startsWith('enterprise-server'), ) allLinks.push({ diff --git a/components/release-notes/GHAEReleaseNotes.tsx b/components/release-notes/GHAEReleaseNotes.tsx index ed63e90e6121..de7c217ad246 100644 --- a/components/release-notes/GHAEReleaseNotes.tsx +++ b/components/release-notes/GHAEReleaseNotes.tsx @@ -40,7 +40,7 @@ export function GHAEReleaseNotes({ context }: GitHubAEProps) {