Skip to content

Commit

Permalink
fix(types): user config prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
songhn233 authored and AdeAttwood committed Aug 12, 2021
1 parent 4825a52 commit 6d7a1c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions @commitlint/load/src/utils/load-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import {cosmiconfig} from 'cosmiconfig';
import TSLoader from '@endemolshinegroup/cosmiconfig-typescript-loader';
import TypeScriptLoader from '@endemolshinegroup/cosmiconfig-typescript-loader';

export interface LoadConfigResult {
config: unknown;
Expand All @@ -26,7 +26,7 @@ export async function loadConfig(
`${moduleName}.config.js`,
],
loaders: {
'.ts': TSLoader,
'.ts': TypeScriptLoader,
},
});

Expand Down
6 changes: 3 additions & 3 deletions @commitlint/types/src/load.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PromptConfig, UserPromptConfig} from './prompt';
import {UserPromptConfig} from './prompt';
import {
AsyncRule,
Rule,
Expand Down Expand Up @@ -29,7 +29,7 @@ export interface UserConfig {
defaultIgnores?: boolean;
plugins?: (string | Plugin)[];
helpUrl?: string;
prompt?: PromptConfig;
prompt?: UserPromptConfig;
}

export interface UserPreset {
Expand All @@ -40,7 +40,7 @@ export interface UserPreset {
ignores?: ((commit: string) => boolean)[];
defaultIgnores?: boolean;
plugins: PluginRecords;
prompt?: PromptConfig;
prompt?: UserPromptConfig;
}

export type QualifiedRules = Partial<RulesConfig<RuleConfigQuality.Qualified>>;
Expand Down
14 changes: 7 additions & 7 deletions @commitlint/types/src/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ export type PromptConfig = {
};

export type PromptMessages = {
skip?: string;
max?: string;
min?: string;
emptyWarning?: string;
upperLimitWarning?: string;
lowerLimitWarning?: string;
[_key: string]: string | undefined;
skip: string;
max: string;
min: string;
emptyWarning: string;
upperLimitWarning: string;
lowerLimitWarning: string;
[_key: string]: string;
};

export type UserPromptConfig = DeepPartial<PromptConfig>;
Expand Down

0 comments on commit 6d7a1c4

Please sign in to comment.