Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(prompt): correct import kind in prompt package #2852

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions @commitlint/prompt/src/index.ts
Expand Up @@ -3,6 +3,12 @@ import {input} from './input';

type Commit = (input: string) => void;

/**
* Entry point for commitizen
* @param cz inquirer instance passed by commitizen, unused
* @param commit callback to execute with complete commit message
* @return {void}
*/
export function prompter(cz: typeof inquirer, commit: Commit): void {
input(cz.prompt).then((message) => {
commit(message);
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/prompt/src/input.ts
@@ -1,5 +1,5 @@
import load from '@commitlint/load';
import {DistinctQuestion, PromptModule} from 'inquirer';
import type {DistinctQuestion, PromptModule} from 'inquirer';

import format from './library/format';
import getPrompt from './library/get-prompt';
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/prompt/src/inquirer/InputCustomPrompt.ts
Expand Up @@ -3,7 +3,7 @@ import chalk from 'chalk';
import inquirer from 'inquirer';
import InputPrompt from 'inquirer/lib/prompts/input';
import observe from 'inquirer/lib/utils/events';
import {Interface as ReadlineInterface, Key} from 'readline';
import type {Interface as ReadlineInterface, Key} from 'readline';
import type {Subscription} from 'rxjs/internal/Subscription';

import Answers = inquirer.Answers;
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/prompt/src/library/format.test.ts
@@ -1,4 +1,4 @@
import {Result} from './types';
import type {Result} from './types';
import format from './format';

test('should return empty string', () => {
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/prompt/src/library/format.ts
@@ -1,5 +1,5 @@
import chalk from 'chalk';
import {Result, ResultPart} from './types';
import type {Result, ResultPart} from './types';

/**
* Get formatted commit message
Expand Down
4 changes: 2 additions & 2 deletions @commitlint/prompt/src/library/get-forced-case-fn.ts
@@ -1,7 +1,7 @@
import {toCase} from '@commitlint/ensure';
import {RuleEntry} from './types';
import {ruleIsActive, ruleIsNotApplicable} from './utils';
import {TargetCaseType} from '@commitlint/types';
import type {RuleEntry} from './types';
import type {TargetCaseType} from '@commitlint/types';

/**
* Get forced case for rule
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/prompt/src/library/get-forced-leading-fn.ts
@@ -1,4 +1,4 @@
import {RuleEntry} from './types';
import type {RuleEntry} from './types';
import {ruleIsActive, ruleIsNotApplicable} from './utils';

/**
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/prompt/src/library/get-prompt.ts
@@ -1,5 +1,5 @@
import chalk from 'chalk';
import {InputCustomOptions} from 'inquirer';
import type {InputCustomOptions} from 'inquirer';

import type {InputSetting, RuleEntry, Result, ResultPart} from './types';

Expand Down
2 changes: 1 addition & 1 deletion @commitlint/prompt/src/library/types.ts
@@ -1,4 +1,4 @@
import {RuleConfigCondition, RuleConfigSeverity} from '@commitlint/types';
import type {RuleConfigCondition, RuleConfigSeverity} from '@commitlint/types';

export type RuleEntry =
| [string, Readonly<[RuleConfigSeverity.Disabled]>]
Expand Down
5 changes: 3 additions & 2 deletions @commitlint/prompt/src/library/utils.ts
@@ -1,5 +1,6 @@
import {QualifiedRules, RuleConfigSeverity} from '@commitlint/types';
import {RuleEntry} from './types';
import {RuleConfigSeverity} from '@commitlint/types';
import type {QualifiedRules} from '@commitlint/types';
import type {RuleEntry} from './types';

/**
* Get name for a given rule id
Expand Down