From b8a0cb41a880822dd6dd5c661bd3d7a1551078d3 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 3 Oct 2024 15:42:55 -0700 Subject: [PATCH] chore: convert JSDoc comments to TSDoc (#168) --- src/24-hour-rule.ts | 10 +++------- src/api-review-state.ts | 5 +---- src/utils/env-util.ts | 6 +++--- src/utils/log-util.ts | 6 +++--- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/24-hour-rule.ts b/src/24-hour-rule.ts index fa5c9ad..c91ac7b 100644 --- a/src/24-hour-rule.ts +++ b/src/24-hour-rule.ts @@ -23,9 +23,7 @@ const CHECK_INTERVAL = 1000 * 60 * 5; type TimelineEvents = RestEndpointMethodTypes['issues']['listEventsForTimeline']['response']; /** - * - * @param {EventPayloads.WebhookPayloadPullRequestPullRequest} pr - * @returns {number} a number representing the minimum open time for the PR + * @returns a number representing the minimum open time for the PR * based on its semantic prefix in milliseconds */ export const getMinimumOpenTime = (pr: PullRequest): number => { @@ -42,10 +40,8 @@ export const getMinimumOpenTime = (pr: PullRequest): number => { }; /** - * - * @param {Context['github']} github An Octokit instance - * @param {EventPayloads.WebhookPayloadPullRequestPullRequest} pr - * @returns {number} a number representing the that cation should use as the + * @param github - An Octokit instance + * @returns a number representing the that cation should use as the * open time for the PR in milliseconds, taking draft status into account. */ export const getPROpenedTime = async ( diff --git a/src/api-review-state.ts b/src/api-review-state.ts index 7d113f4..74c164c 100644 --- a/src/api-review-state.ts +++ b/src/api-review-state.ts @@ -38,7 +38,6 @@ export const isSemverMajorMinorLabel = (label: string) => /** * Determines the PR readiness date depending on its semver label. * - * @param {EventPayloads.WebhookPayloadPullRequestPullRequest} pr * @returns a date corresponding to the time that must elapse before a PR requiring * API review is ready to be merged according to its semver label. */ @@ -314,9 +313,7 @@ export async function addOrUpdateAPIReviewCheck(octokit: Context['octokit'], pr: /** * Determines whether or not a PR is ready for merge depending on API WG Reviews. * - * @param {Context['octokit']} octokit - * @param {EventPayloads.WebhookPayloadPullRequestPullRequest} pr - * @param {APIApprovalState} userApprovalState How many users have + * @param userApprovalState - How many users have * approved/declined/requested changes for the PR. */ export async function checkPRReadyForMerge( diff --git a/src/utils/env-util.ts b/src/utils/env-util.ts index c10c7c6..5b11986 100644 --- a/src/utils/env-util.ts +++ b/src/utils/env-util.ts @@ -5,9 +5,9 @@ import { log } from './log-util'; * Checks that a given environment variable exists, and returns * its value if it does. Conditionally throws an error on failure. * - * @param {string} envVar - the environment variable to retrieve - * @param {string} defaultValue - default value to use if no environment var is found - * @returns {string} - the value of the env var being checked, or the default value if one is passed + * @param envVar - the environment variable to retrieve + * @param defaultValue - default value to use if no environment var is found + * @returns the value of the env var being checked, or the default value if one is passed */ export function getEnvVar(envVar: string, defaultValue?: string): string { log('getEnvVar', LogLevel.INFO, `Fetching env var '${envVar}'`); diff --git a/src/utils/log-util.ts b/src/utils/log-util.ts index 169a93b..ef4ebcf 100644 --- a/src/utils/log-util.ts +++ b/src/utils/log-util.ts @@ -3,9 +3,9 @@ import { LogLevel } from '../enums'; /** * Logs information about different actions taking place to console. * - * @param {string} functionName - the name of the function where the logging is happening - * @param {LogLevel }logLevel - the severity level of the log - * @param {any[]} message - the message to write to console + * @param functionName - the name of the function where the logging is happening + * @param logLevel - the severity level of the log + * @param message - the message to write to console */ export const log = (functionName: string, logLevel: LogLevel, ...message: unknown[]) => { const output = `${functionName}: ${message}`;