From b283ad61b6a84b67b56c6d32c65b134e563b0857 Mon Sep 17 00:00:00 2001 From: curly Date: Wed, 10 Mar 2021 12:25:19 +0800 Subject: [PATCH 1/2] fix(prompt): modify the entry point to pass commitizen's function check Async Function type cannot be verified by commitizen's function check, modify to Function type. issue: https://github.com/conventional-changelog/commitlint/issues/2486#issuecomment-791682272 --- @commitlint/prompt/src/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/@commitlint/prompt/src/index.ts b/@commitlint/prompt/src/index.ts index 4a6261422b..134c621e59 100644 --- a/@commitlint/prompt/src/index.ts +++ b/@commitlint/prompt/src/index.ts @@ -9,9 +9,10 @@ type Commit = (input: string) => void; * Entry point for commitizen * @param _ inquirer instance passed by commitizen, unused * @param commit callback to execute with complete commit message - * @return generated commit message + * @return {void} */ -export async function prompter(_: unknown, commit: Commit): Promise { - const message = await input(vorpal); - commit(message); +export function prompter(_: unknown, commit: Commit): void { + input(vorpal).then((message) => { + commit(message); + }); } From 1d1fbd8e68a611209e24bcc403cb13e9abddde4b Mon Sep 17 00:00:00 2001 From: Curly Date: Wed, 10 Mar 2021 12:31:05 +0800 Subject: [PATCH 2/2] fix(prompt): modify the entry point to pass commitizen's function check Async Function type cannot be verified by commitizen's function check, modify to Function type. issue: https://github.com/conventional-changelog/commitlint/issues/2486#issuecomment-791682272 --- @commitlint/prompt/src/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/@commitlint/prompt/src/index.ts b/@commitlint/prompt/src/index.ts index 4a6261422b..134c621e59 100644 --- a/@commitlint/prompt/src/index.ts +++ b/@commitlint/prompt/src/index.ts @@ -9,9 +9,10 @@ type Commit = (input: string) => void; * Entry point for commitizen * @param _ inquirer instance passed by commitizen, unused * @param commit callback to execute with complete commit message - * @return generated commit message + * @return {void} */ -export async function prompter(_: unknown, commit: Commit): Promise { - const message = await input(vorpal); - commit(message); +export function prompter(_: unknown, commit: Commit): void { + input(vorpal).then((message) => { + commit(message); + }); }