Skip to content

Commit ec54871

Browse files
committed
feat(prompt): drop support for :skip conventional-changelog#46
1 parent 0c1cc54 commit ec54871

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

@commitlint/prompt/src/inquirer/InputCustomPrompt.ts

+3-21
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import inquirer from 'inquirer';
55
import InputPrompt from 'inquirer/lib/prompts/input';
66
import observe from 'inquirer/lib/utils/events';
77

8-
import SuccessfulPromptStateData = inquirer.prompts.SuccessfulPromptStateData;
98
import Answers = inquirer.Answers;
109
import InputCustomOptions = inquirer.InputCustomOptions;
1110
import Validator = inquirer.Validator;
@@ -44,17 +43,9 @@ export default class InputCustomPrompt<
4443
if (input.length > this.opt.maxLength(answers)) {
4544
return 'Input contains too many characters!';
4645
}
47-
if (input.length === 0) {
48-
if (!this.opt.required) {
49-
return chalk.blue(
50-
`ℹ Enter ${chalk.bold(':skip')} to omit ${chalk.bold(
51-
this.opt.name
52-
)}.`
53-
);
54-
} else {
55-
// Show help if enum is defined and input may not be empty
56-
return `⚠ ${chalk.bold(this.opt.name)} may not be empty.`;
57-
}
46+
if (input.length === 0 && this.opt.required) {
47+
// Show help if enum is defined and input may not be empty
48+
return `⚠ ${chalk.bold(this.opt.name)} may not be empty.`;
5849
}
5950

6051
if (validate) {
@@ -75,15 +66,6 @@ export default class InputCustomPrompt<
7566
// process.exit(1)
7667
}
7768

78-
onEnd(eventArgs: SuccessfulPromptStateData): void {
79-
if (!this.opt.required) {
80-
if (eventArgs.value === ':skip') {
81-
eventArgs.value = '';
82-
}
83-
}
84-
super.onEnd(eventArgs);
85-
}
86-
8769
measureInput(input: string): number {
8870
if (this.opt.filter) {
8971
return this.opt.filter(input, this.answers).length;

0 commit comments

Comments
 (0)