-
Notifications
You must be signed in to change notification settings - Fork 934
/
Copy pathload.ts
64 lines (56 loc) · 1.32 KB
/
load.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import {UserPromptConfig} from './prompt';
import {
AsyncRule,
Rule,
RuleConfigQuality,
RulesConfig,
SyncRule,
} from './rules';
export type PluginRecords = Record<string, Plugin>;
export interface Plugin {
rules: {
[ruleName: string]: Rule | AsyncRule | SyncRule;
};
}
export interface LoadOptions {
cwd?: string;
file?: string;
}
export interface UserConfig {
extends?: string[];
formatter?: string;
rules?: Partial<RulesConfig>;
parserPreset?: string | ParserPreset;
ignores?: ((commit: string) => boolean)[];
defaultIgnores?: boolean;
plugins?: (string | Plugin)[];
helpUrl?: string;
prompt?: UserPromptConfig;
}
export interface UserPreset {
extends?: string[];
formatter?: string;
rules?: Partial<RulesConfig>;
parserPreset?: string | ParserPreset;
ignores?: ((commit: string) => boolean)[];
defaultIgnores?: boolean;
plugins: PluginRecords;
prompt?: UserPromptConfig;
}
export type QualifiedRules = Partial<RulesConfig<RuleConfigQuality.Qualified>>;
export interface QualifiedConfig {
extends: string[];
formatter: string;
rules: QualifiedRules;
parserPreset: ParserPreset;
ignores: ((commit: string) => boolean)[];
defaultIgnores: boolean;
plugins: PluginRecords;
helpUrl: string;
prompt: UserPromptConfig;
}
export interface ParserPreset {
name: string;
path: string;
parserOpts?: unknown;
}