Skip to content

Commit

Permalink
fix(prompt): correct import kind in prompt package (#2852)
Browse files Browse the repository at this point in the history
* fix(prompt): correct import kind in prompt package

* fix(prompt): revert chalk type imports
  • Loading branch information
armano2 committed Nov 8, 2021
1 parent b1155ca commit 45bf394
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 11 deletions.
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

0 comments on commit 45bf394

Please sign in to comment.