From 69fd8ff701bff76f2a834ac277ee89d0248dad41 Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Mon, 21 Nov 2022 10:48:58 +0100 Subject: [PATCH] refactor: adjust code to match eslint rules --- src/api.ts | 208 +++++++++++++++++++++++++-------------------------- src/cli.ts | 153 ++++++++++++++++++------------------- src/types.ts | 2 +- 3 files changed, 181 insertions(+), 182 deletions(-) diff --git a/src/api.ts b/src/api.ts index a8886da2..fae82b64 100644 --- a/src/api.ts +++ b/src/api.ts @@ -41,7 +41,7 @@ import { * @param ms Number of milliseconds to wait */ export async function sleep(ms: number): Promise { - return new Promise((resolve) => setTimeout(resolve, ms)); + return new Promise(resolve => setTimeout(resolve, ms)); } /** @@ -120,20 +120,19 @@ export class Api { * @param userId ID of the user * @param accessLevel Access level for the new member in the scope */ - public async addMember(scope: MembershipScope, - id: number, - userId: number, - accessLevel: AccessLevel): Promise { - return this.makeGitLabAPIRequest( - `${scope}/${id}/members`, - { - data: { - access_level: accessLevel, - user_id: userId, - }, - method: 'POST', + public async addMember( + scope: MembershipScope, + id: number, + userId: number, + accessLevel: AccessLevel, + ): Promise { + return this.makeGitLabAPIRequest(`${scope}/${id}/members`, { + data: { + access_level: accessLevel, + user_id: userId, }, - ) as Promise; + method: 'POST', + }) as Promise; } /** @@ -144,16 +143,13 @@ export class Api { * @param description Description of the issue (can contain slash commands) */ public async createIssue(projectId: number, title: string, description: string): Promise { - return this.makeGitLabAPIRequest( - `projects/${projectId}/issues`, - { - data: { - description: description, - title: title, - }, - method: 'POST', + return this.makeGitLabAPIRequest(`projects/${projectId}/issues`, { + data: { + description: description, + title: title, }, - ) as Promise; + method: 'POST', + }) as Promise; } /** @@ -164,23 +160,25 @@ export class Api { * @param description Description of the label to create * @param color Color of the label to create */ - public async createLabel(projectId: number, name: string, description?: string, color?: string): Promise