Skip to content

Commit 6d7a1c4

Browse files
songhn233AdeAttwood
authored andcommitted
fix(types): user config prompt
1 parent 4825a52 commit 6d7a1c4

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

@commitlint/load/src/utils/load-config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from 'path';
22
import {cosmiconfig} from 'cosmiconfig';
3-
import TSLoader from '@endemolshinegroup/cosmiconfig-typescript-loader';
3+
import TypeScriptLoader from '@endemolshinegroup/cosmiconfig-typescript-loader';
44

55
export interface LoadConfigResult {
66
config: unknown;
@@ -26,7 +26,7 @@ export async function loadConfig(
2626
`${moduleName}.config.js`,
2727
],
2828
loaders: {
29-
'.ts': TSLoader,
29+
'.ts': TypeScriptLoader,
3030
},
3131
});
3232

@commitlint/types/src/load.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {PromptConfig, UserPromptConfig} from './prompt';
1+
import {UserPromptConfig} from './prompt';
22
import {
33
AsyncRule,
44
Rule,
@@ -29,7 +29,7 @@ export interface UserConfig {
2929
defaultIgnores?: boolean;
3030
plugins?: (string | Plugin)[];
3131
helpUrl?: string;
32-
prompt?: PromptConfig;
32+
prompt?: UserPromptConfig;
3333
}
3434

3535
export interface UserPreset {
@@ -40,7 +40,7 @@ export interface UserPreset {
4040
ignores?: ((commit: string) => boolean)[];
4141
defaultIgnores?: boolean;
4242
plugins: PluginRecords;
43-
prompt?: PromptConfig;
43+
prompt?: UserPromptConfig;
4444
}
4545

4646
export type QualifiedRules = Partial<RulesConfig<RuleConfigQuality.Qualified>>;

@commitlint/types/src/prompt.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ export type PromptConfig = {
3636
};
3737

3838
export type PromptMessages = {
39-
skip?: string;
40-
max?: string;
41-
min?: string;
42-
emptyWarning?: string;
43-
upperLimitWarning?: string;
44-
lowerLimitWarning?: string;
45-
[_key: string]: string | undefined;
39+
skip: string;
40+
max: string;
41+
min: string;
42+
emptyWarning: string;
43+
upperLimitWarning: string;
44+
lowerLimitWarning: string;
45+
[_key: string]: string;
4646
};
4747

4848
export type UserPromptConfig = DeepPartial<PromptConfig>;

0 commit comments

Comments
 (0)