diff --git a/ng-dev/caretaker/BUILD.bazel b/ng-dev/caretaker/BUILD.bazel index 96bfbc944..45a66d561 100644 --- a/ng-dev/caretaker/BUILD.bazel +++ b/ng-dev/caretaker/BUILD.bazel @@ -10,7 +10,6 @@ ts_library( deps = [ "//ng-dev/release/versioning", "//ng-dev/utils", - "@npm//@octokit/plugin-rest-endpoint-methods", "@npm//@types/inquirer", "@npm//@types/node", "@npm//@types/yargs", diff --git a/ng-dev/caretaker/handoff/update-github-team.ts b/ng-dev/caretaker/handoff/update-github-team.ts index c884d5573..b58f4783b 100644 --- a/ng-dev/caretaker/handoff/update-github-team.ts +++ b/ng-dev/caretaker/handoff/update-github-team.ts @@ -12,10 +12,6 @@ import {getConfig} from '../../utils/config.js'; import {green, Log, yellow} from '../../utils/logging.js'; import {AuthenticatedGitClient} from '../../utils/git/authenticated-git-client.js'; import {assertValidCaretakerConfig} from '../config.js'; -import {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods'; - -type GithubOrgMember = - RestEndpointMethodTypes['teams']['listMembersInOrg']['response']['data'][number]; /** Update the Github caretaker group, using a prompt to obtain the new caretaker group members. */ export async function updateCaretakerTeamViaPrompt() { @@ -90,8 +86,8 @@ async function getGroupMembers(group: string) { team_slug: group, }) ).data - .filter((member: GithubOrgMember) => !!member) - .map((member: GithubOrgMember) => member!.login); + .filter((_) => !!_) + .map((member) => member!.login); } async function setCaretakerGroup(group: string, members: string[]) { @@ -102,7 +98,7 @@ async function setCaretakerGroup(group: string, members: string[]) { /** The list of current members of the group. */ const current = await getGroupMembers(group); /** The list of users to be removed from the group. */ - const removed = current.filter((login: string) => !members.includes(login)); + const removed = current.filter((login) => !members.includes(login)); /** Add a user to the group. */ const add = async (username: string) => { Log.debug(`Adding ${username} to ${fullSlug}.`); diff --git a/ng-dev/pr/check-target-branches/BUILD.bazel b/ng-dev/pr/check-target-branches/BUILD.bazel index d07b33c98..097a8301e 100644 --- a/ng-dev/pr/check-target-branches/BUILD.bazel +++ b/ng-dev/pr/check-target-branches/BUILD.bazel @@ -9,7 +9,6 @@ ts_library( "//ng-dev/pr/config", "//ng-dev/release/versioning", "//ng-dev/utils", - "@npm//@octokit/plugin-rest-endpoint-methods", "@npm//@types/yargs", ], ) diff --git a/ng-dev/pr/check-target-branches/check-target-branches.ts b/ng-dev/pr/check-target-branches/check-target-branches.ts index baf244c1a..c7472ffe5 100644 --- a/ng-dev/pr/check-target-branches/check-target-branches.ts +++ b/ng-dev/pr/check-target-branches/check-target-branches.ts @@ -13,9 +13,6 @@ import {assertValidPullRequestConfig, PullRequestConfig} from '../config/index.j import {getTargetBranchesAndLabelForPullRequest} from '../common/targeting/target-label.js'; import {ActiveReleaseTrains} from '../../release/versioning/active-release-trains.js'; import {getNextBranchName} from '../../release/versioning/version-branches.js'; -import {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods'; - -type GithubLabel = RestEndpointMethodTypes['pulls']['get']['response']['data']['labels'][number]; async function getTargetBranchesForPr( prNumber: number, @@ -33,7 +30,7 @@ async function getTargetBranchesForPr( // here. // TODO(devversion): Remove the non-null cast once // https://github.com/github/rest-api-description/issues/169 is fixed. - const labels = prData.labels.map((l: GithubLabel) => l.name!); + const labels = prData.labels.map((l) => l.name!); /** The branch targetted via the Github UI. */ const githubTargetBranch = prData.base.ref; diff --git a/ng-dev/pr/merge/strategies/api-merge.ts b/ng-dev/pr/merge/strategies/api-merge.ts index 24d19799a..c4a854464 100644 --- a/ng-dev/pr/merge/strategies/api-merge.ts +++ b/ng-dev/pr/merge/strategies/api-merge.ts @@ -20,8 +20,6 @@ import {FatalMergeToolError, MergeConflictsFatalError} from '../failures.js'; /** Type describing the parameters for the Octokit `merge` API endpoint. */ type OctokitMergeParams = RestEndpointMethodTypes['pulls']['merge']['parameters']; -type OctokitListCommitsEntry = - RestEndpointMethodTypes['pulls']['listCommits']['response']['data'][number]; /** Separator between commit message header and body. */ const COMMIT_HEADER_SEPARATOR = '\n\n'; @@ -185,12 +183,12 @@ export class GithubApiMergeStrategy extends MergeStrategy { } /** Gets all commit messages of commits in the pull request. */ - private async _getPullRequestCommitMessages({prNumber}: PullRequest): Promise { + private async _getPullRequestCommitMessages({prNumber}: PullRequest) { const allCommits = await this.git.github.paginate(this.git.github.pulls.listCommits, { ...this.git.remoteParams, pull_number: prNumber, }); - return allCommits.map(({commit}: OctokitListCommitsEntry) => commit.message); + return allCommits.map(({commit}) => commit.message); } /** Determines the merge action from the given pull request. */