-
-
Notifications
You must be signed in to change notification settings - Fork 155
/
textlint-kernel-interface.ts
96 lines (90 loc) · 2.5 KB
/
textlint-kernel-interface.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// rule config
import type {
TextlintFilterRuleOptions,
TextlintFilterRuleReporter,
TextlintPluginCreator,
TextlintPluginOptions,
TextlintRuleModule,
TextlintRuleOptions
} from "@textlint/types";
export interface TextlintKernelConstructorOptions {
/**
* Suppress messages of severity:warning and severity:info
*/
quiet?: boolean;
}
// config
export interface TextlintConfigObject {
// rule directories path
rulePaths?: string[];
// filter by file extensions
extensions?: string[];
// formatter file name
// e.g.) stylish.js => set "stylish"
formatterName?: string;
// plugin package names
plugins?: string[];
// base directory for loading {rule, config, plugin} modules
rulesBaseDirectory?: string;
// ".textlint" file path
configFile?: string;
// disabled rule package names
// always should start with empty
disabledRules?: string[];
// preset package names
// e.g.) ["preset-foo"]
presets?: string[];
// rules config object
rulesConfig?: Object;
/**
* quite options
*/
quiet?: boolean;
}
export interface TextlintKernelPlugin {
// plugin name as key
// this key should be normalized
pluginId: string;
// plugin module
// For example, `plugin: require("@textlint/textlint-plugin-markdown")`
plugin: TextlintPluginCreator;
// plugin options
options?: TextlintPluginOptions | boolean;
}
export interface TextlintKernelRule {
// rule name as key
// this key should be normalized
ruleId: string;
// rule module
// For example, `rule: require("textlint-rule-example")`
rule: TextlintRuleModule;
// rule options
// Often rule option is written in .textlintrc
options?: TextlintRuleOptions | boolean;
}
export interface TextlintKernelFilterRule {
// filter rule name as key
// this key should be normalized
ruleId: string;
// filter rule module instance
rule: TextlintFilterRuleReporter;
// filter rule options
// Often rule option is written in .textlintrc
options?: TextlintFilterRuleOptions | boolean;
}
export interface TextlintKernelOptions {
// file type
// For example) .md
ext: string;
// file path
filePath?: string;
// plugins
plugins?: TextlintKernelPlugin[];
// rules
rules?: TextlintKernelRule[];
// filterRules
filterRules?: TextlintKernelFilterRule[];
// config base directory
// It is a value of context.getConfigBaseDir.
configBaseDir?: string;
}