-
Notifications
You must be signed in to change notification settings - Fork 933
/
Copy pathload.ts
54 lines (46 loc) · 1.15 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
import {Rule, RulesConfig, RuleConfigQuality} from './rules';
export type PluginRecords = Record<string, Plugin>;
export interface Plugin {
rules: {
[ruleName: string]: Rule<unknown>;
};
}
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;
}
export interface UserPreset {
extends?: string[];
formatter?: string;
rules?: Partial<RulesConfig>;
parserPreset?: string | ParserPreset;
ignores?: ((commit: string) => boolean)[];
defaultIgnores?: boolean;
plugins: PluginRecords;
}
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;
}
export interface ParserPreset {
name: string;
path: string;
parserOpts?: unknown;
}