markdownlint 0.20.2 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +50 -47
- package/LICENSE +21 -21
- package/README.md +915 -871
- package/demo/markdownlint-browser.js +4693 -5400
- package/doc/CustomRules.md +315 -313
- package/doc/Rules.md +1868 -1795
- package/helpers/LICENSE +21 -21
- package/helpers/README.md +50 -50
- package/helpers/helpers.js +690 -671
- package/helpers/package.json +18 -18
- package/lib/cache.js +24 -24
- package/lib/markdownlint.d.ts +365 -352
- package/lib/markdownlint.js +1186 -1101
- package/lib/md001.js +22 -22
- package/lib/md002.js +22 -22
- package/lib/md003.js +42 -42
- package/lib/md004.js +43 -43
- package/lib/md005.js +69 -69
- package/lib/md006.js +34 -34
- package/lib/md007.js +47 -47
- package/lib/md009.js +77 -77
- package/lib/md010.js +38 -38
- package/lib/md011.js +42 -38
- package/lib/md012.js +32 -32
- package/lib/md013.js +99 -99
- package/lib/md014.js +53 -53
- package/lib/md018.js +34 -34
- package/lib/md019.js +39 -39
- package/lib/md020.js +62 -62
- package/lib/md021.js +60 -60
- package/lib/md022.js +56 -56
- package/lib/md023.js +38 -38
- package/lib/md024.js +38 -38
- package/lib/md025.js +32 -32
- package/lib/md026.js +40 -40
- package/lib/md027.js +56 -56
- package/lib/md028.js +38 -38
- package/lib/md029.js +66 -66
- package/lib/md030.js +50 -50
- package/lib/md031.js +40 -39
- package/lib/md032.js +50 -50
- package/lib/md033.js +45 -45
- package/lib/md034.js +61 -61
- package/lib/md035.js +21 -21
- package/lib/md036.js +56 -56
- package/lib/md037.js +150 -141
- package/lib/md038.js +68 -68
- package/lib/md039.js +64 -64
- package/lib/md040.js +18 -18
- package/lib/md041.js +31 -31
- package/lib/md042.js +42 -41
- package/lib/md043.js +45 -45
- package/lib/md044.js +94 -71
- package/lib/md045.js +18 -18
- package/lib/md046.js +32 -32
- package/lib/md047.js +28 -28
- package/lib/md048.js +29 -29
- package/lib/rules.js +60 -61
- package/package.json +74 -67
- package/schema/build-config-schema.js +409 -405
- package/schema/markdownlint-config-schema.json +7 -2
- package/style/all.json +5 -5
- package/style/cirosantilli.json +22 -22
- package/style/relaxed.json +13 -13
|
@@ -1,405 +1,409 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const path = require("path");
|
|
7
|
-
const rules = require("../lib/rules");
|
|
8
|
-
|
|
9
|
-
// Schema scaffolding
|
|
10
|
-
const schema = {
|
|
11
|
-
"title": "Markdownlint configuration schema",
|
|
12
|
-
"type": "object",
|
|
13
|
-
"properties": {
|
|
14
|
-
"default": {
|
|
15
|
-
"description": "Default state for all rules",
|
|
16
|
-
"type": "boolean",
|
|
17
|
-
"default": true
|
|
18
|
-
},
|
|
19
|
-
"extends": {
|
|
20
|
-
"description": "Path to configuration file to extend",
|
|
21
|
-
"type": "string",
|
|
22
|
-
"default": null
|
|
23
|
-
},
|
|
24
|
-
"$schema": {
|
|
25
|
-
"description": "JSON Schema URI (used by some editors)",
|
|
26
|
-
"type": "string",
|
|
27
|
-
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint" +
|
|
28
|
-
"/
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"additionalProperties":
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
"
|
|
162
|
-
"
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"
|
|
201
|
-
"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
"
|
|
215
|
-
"
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
"
|
|
254
|
-
"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
"
|
|
264
|
-
"
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
"
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
"
|
|
309
|
-
"
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
"
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
"
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
"
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
"
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
"
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const rules = require("../lib/rules");
|
|
8
|
+
|
|
9
|
+
// Schema scaffolding
|
|
10
|
+
const schema = {
|
|
11
|
+
"title": "Markdownlint configuration schema",
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"default": {
|
|
15
|
+
"description": "Default state for all rules",
|
|
16
|
+
"type": "boolean",
|
|
17
|
+
"default": true
|
|
18
|
+
},
|
|
19
|
+
"extends": {
|
|
20
|
+
"description": "Path to configuration file to extend",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": null
|
|
23
|
+
},
|
|
24
|
+
"$schema": {
|
|
25
|
+
"description": "JSON Schema URI (used by some editors)",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint" +
|
|
28
|
+
"/main/schema/markdownlint-config-schema.json"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"additionalProperties": {
|
|
32
|
+
"type:": [
|
|
33
|
+
"boolean",
|
|
34
|
+
"object"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const tags = {};
|
|
39
|
+
|
|
40
|
+
// Add rules
|
|
41
|
+
rules.forEach(function forRule(rule) {
|
|
42
|
+
rule.tags.forEach(function forTag(tag) {
|
|
43
|
+
const tagRules = tags[tag] || [];
|
|
44
|
+
tagRules.push(rule.names[0]);
|
|
45
|
+
tags[tag] = tagRules;
|
|
46
|
+
});
|
|
47
|
+
const scheme = {
|
|
48
|
+
"description": rule.names.join("/") + " - " + rule.description,
|
|
49
|
+
"type": "boolean",
|
|
50
|
+
"default": true
|
|
51
|
+
};
|
|
52
|
+
let custom = true;
|
|
53
|
+
switch (rule.names[0]) {
|
|
54
|
+
case "MD002":
|
|
55
|
+
scheme.properties = {
|
|
56
|
+
"level": {
|
|
57
|
+
"description": "Heading level",
|
|
58
|
+
"type": "integer",
|
|
59
|
+
"default": 1
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
break;
|
|
63
|
+
case "MD003":
|
|
64
|
+
scheme.properties = {
|
|
65
|
+
"style": {
|
|
66
|
+
"description": "Heading style",
|
|
67
|
+
"type": "string",
|
|
68
|
+
"enum": [
|
|
69
|
+
"consistent",
|
|
70
|
+
"atx",
|
|
71
|
+
"atx_closed",
|
|
72
|
+
"setext",
|
|
73
|
+
"setext_with_atx",
|
|
74
|
+
"setext_with_atx_closed"
|
|
75
|
+
],
|
|
76
|
+
"default": "consistent"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
break;
|
|
80
|
+
case "MD004":
|
|
81
|
+
scheme.properties = {
|
|
82
|
+
"style": {
|
|
83
|
+
"description": "List style",
|
|
84
|
+
"type": "string",
|
|
85
|
+
"enum": [
|
|
86
|
+
"consistent",
|
|
87
|
+
"asterisk",
|
|
88
|
+
"plus",
|
|
89
|
+
"dash",
|
|
90
|
+
"sublist"
|
|
91
|
+
],
|
|
92
|
+
"default": "consistent"
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
break;
|
|
96
|
+
case "MD007":
|
|
97
|
+
scheme.properties = {
|
|
98
|
+
"indent": {
|
|
99
|
+
"description": "Spaces for indent",
|
|
100
|
+
"type": "integer",
|
|
101
|
+
"default": 2
|
|
102
|
+
},
|
|
103
|
+
"start_indented": {
|
|
104
|
+
"description": "Whether to indent the first level of the list",
|
|
105
|
+
"type": "boolean",
|
|
106
|
+
"default": false
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
break;
|
|
110
|
+
case "MD009":
|
|
111
|
+
scheme.properties = {
|
|
112
|
+
"br_spaces": {
|
|
113
|
+
"description": "Spaces for line break",
|
|
114
|
+
"type": "integer",
|
|
115
|
+
"default": 2
|
|
116
|
+
},
|
|
117
|
+
"list_item_empty_lines": {
|
|
118
|
+
"description": "Allow spaces for empty lines in list items",
|
|
119
|
+
"type": "boolean",
|
|
120
|
+
"default": false
|
|
121
|
+
},
|
|
122
|
+
"strict": {
|
|
123
|
+
"description": "Include unnecessary breaks",
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"default": false
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
break;
|
|
129
|
+
case "MD010":
|
|
130
|
+
scheme.properties = {
|
|
131
|
+
"code_blocks": {
|
|
132
|
+
"description": "Include code blocks",
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"default": true
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
break;
|
|
138
|
+
case "MD012":
|
|
139
|
+
scheme.properties = {
|
|
140
|
+
"maximum": {
|
|
141
|
+
"description": "Consecutive blank lines",
|
|
142
|
+
"type": "integer",
|
|
143
|
+
"default": 1
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
break;
|
|
147
|
+
case "MD013":
|
|
148
|
+
scheme.properties = {
|
|
149
|
+
"line_length": {
|
|
150
|
+
"description": "Number of characters",
|
|
151
|
+
"type": "integer",
|
|
152
|
+
"default": 80
|
|
153
|
+
},
|
|
154
|
+
"heading_line_length": {
|
|
155
|
+
"description": "Number of characters for headings",
|
|
156
|
+
"type": "integer",
|
|
157
|
+
"default": 80
|
|
158
|
+
},
|
|
159
|
+
"code_block_line_length": {
|
|
160
|
+
"description": "Number of characters for code blocks",
|
|
161
|
+
"type": "integer",
|
|
162
|
+
"default": 80
|
|
163
|
+
},
|
|
164
|
+
"code_blocks": {
|
|
165
|
+
"description": "Include code blocks",
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"default": true
|
|
168
|
+
},
|
|
169
|
+
"tables": {
|
|
170
|
+
"description": "Include tables",
|
|
171
|
+
"type": "boolean",
|
|
172
|
+
"default": true
|
|
173
|
+
},
|
|
174
|
+
"headings": {
|
|
175
|
+
"description": "Include headings",
|
|
176
|
+
"type": "boolean",
|
|
177
|
+
"default": true
|
|
178
|
+
},
|
|
179
|
+
"headers": {
|
|
180
|
+
"description": "Include headings",
|
|
181
|
+
"type": "boolean",
|
|
182
|
+
"default": true
|
|
183
|
+
},
|
|
184
|
+
"strict": {
|
|
185
|
+
"description": "Strict length checking",
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"default": false
|
|
188
|
+
},
|
|
189
|
+
"stern": {
|
|
190
|
+
"description": "Stern length checking",
|
|
191
|
+
"type": "boolean",
|
|
192
|
+
"default": false
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
break;
|
|
196
|
+
case "MD022":
|
|
197
|
+
scheme.properties = {
|
|
198
|
+
"lines_above": {
|
|
199
|
+
"description": "Blank lines above heading",
|
|
200
|
+
"type": "integer",
|
|
201
|
+
"default": 1
|
|
202
|
+
},
|
|
203
|
+
"lines_below": {
|
|
204
|
+
"description": "Blank lines below heading",
|
|
205
|
+
"type": "integer",
|
|
206
|
+
"default": 1
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
break;
|
|
210
|
+
case "MD024":
|
|
211
|
+
scheme.properties = {
|
|
212
|
+
"allow_different_nesting": {
|
|
213
|
+
"description": "Only check sibling headings",
|
|
214
|
+
"type": "boolean",
|
|
215
|
+
"default": false
|
|
216
|
+
},
|
|
217
|
+
"siblings_only": {
|
|
218
|
+
"description": "Only check sibling headings",
|
|
219
|
+
"type": "boolean",
|
|
220
|
+
"default": false
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
break;
|
|
224
|
+
case "MD026":
|
|
225
|
+
case "MD036":
|
|
226
|
+
scheme.properties = {
|
|
227
|
+
"punctuation": {
|
|
228
|
+
"description": "Punctuation characters",
|
|
229
|
+
"type": "string",
|
|
230
|
+
"default": ".,;:!?。,;:!?"
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
break;
|
|
234
|
+
case "MD029":
|
|
235
|
+
scheme.properties = {
|
|
236
|
+
"style": {
|
|
237
|
+
"description": "List style",
|
|
238
|
+
"type": "string",
|
|
239
|
+
"enum": [
|
|
240
|
+
"one",
|
|
241
|
+
"ordered",
|
|
242
|
+
"one_or_ordered",
|
|
243
|
+
"zero"
|
|
244
|
+
],
|
|
245
|
+
"default": "one_or_ordered"
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
break;
|
|
249
|
+
case "MD030":
|
|
250
|
+
scheme.properties = {
|
|
251
|
+
"ul_single": {
|
|
252
|
+
"description": "Spaces for single-line unordered list items",
|
|
253
|
+
"type": "integer",
|
|
254
|
+
"default": 1
|
|
255
|
+
},
|
|
256
|
+
"ol_single": {
|
|
257
|
+
"description": "Spaces for single-line ordered list items",
|
|
258
|
+
"type": "integer",
|
|
259
|
+
"default": 1
|
|
260
|
+
},
|
|
261
|
+
"ul_multi": {
|
|
262
|
+
"description": "Spaces for multi-line unordered list items",
|
|
263
|
+
"type": "integer",
|
|
264
|
+
"default": 1
|
|
265
|
+
},
|
|
266
|
+
"ol_multi": {
|
|
267
|
+
"description": "Spaces for multi-line ordered list items",
|
|
268
|
+
"type": "integer",
|
|
269
|
+
"default": 1
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
break;
|
|
273
|
+
case "MD031":
|
|
274
|
+
scheme.properties = {
|
|
275
|
+
"list_items": {
|
|
276
|
+
"description": "Include list items",
|
|
277
|
+
"type": "boolean",
|
|
278
|
+
"default": true
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
break;
|
|
282
|
+
case "MD033":
|
|
283
|
+
scheme.properties = {
|
|
284
|
+
"allowed_elements": {
|
|
285
|
+
"description": "Allowed elements",
|
|
286
|
+
"type": "array",
|
|
287
|
+
"items": {
|
|
288
|
+
"type": "string"
|
|
289
|
+
},
|
|
290
|
+
"default": []
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
break;
|
|
294
|
+
case "MD035":
|
|
295
|
+
scheme.properties = {
|
|
296
|
+
"style": {
|
|
297
|
+
"description": "Horizontal rule style",
|
|
298
|
+
"type": "string",
|
|
299
|
+
"default": "consistent"
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
break;
|
|
303
|
+
case "MD025":
|
|
304
|
+
case "MD041":
|
|
305
|
+
scheme.properties = {
|
|
306
|
+
"level": {
|
|
307
|
+
"description": "Heading level",
|
|
308
|
+
"type": "integer",
|
|
309
|
+
"default": 1
|
|
310
|
+
},
|
|
311
|
+
"front_matter_title": {
|
|
312
|
+
"description": "RegExp for matching title in front matter",
|
|
313
|
+
"type": "string",
|
|
314
|
+
"default": "^\\s*title\\s*[:=]"
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
break;
|
|
318
|
+
case "MD043":
|
|
319
|
+
scheme.properties = {
|
|
320
|
+
"headings": {
|
|
321
|
+
"description": "List of headings",
|
|
322
|
+
"type": "array",
|
|
323
|
+
"items": {
|
|
324
|
+
"type": "string"
|
|
325
|
+
},
|
|
326
|
+
"default": null
|
|
327
|
+
},
|
|
328
|
+
"headers": {
|
|
329
|
+
"description": "List of headings",
|
|
330
|
+
"type": "array",
|
|
331
|
+
"items": {
|
|
332
|
+
"type": "string"
|
|
333
|
+
},
|
|
334
|
+
"default": null
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
break;
|
|
338
|
+
case "MD044":
|
|
339
|
+
scheme.properties = {
|
|
340
|
+
"names": {
|
|
341
|
+
"description": "List of proper names",
|
|
342
|
+
"type": "array",
|
|
343
|
+
"items": {
|
|
344
|
+
"type": "string"
|
|
345
|
+
},
|
|
346
|
+
"default": null
|
|
347
|
+
},
|
|
348
|
+
"code_blocks": {
|
|
349
|
+
"description": "Include code blocks",
|
|
350
|
+
"type": "boolean",
|
|
351
|
+
"default": true
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
break;
|
|
355
|
+
case "MD046":
|
|
356
|
+
scheme.properties = {
|
|
357
|
+
"style": {
|
|
358
|
+
"description": "Block style",
|
|
359
|
+
"type": "string",
|
|
360
|
+
"enum": [
|
|
361
|
+
"consistent",
|
|
362
|
+
"fenced",
|
|
363
|
+
"indented"
|
|
364
|
+
],
|
|
365
|
+
"default": "consistent"
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
break;
|
|
369
|
+
case "MD048":
|
|
370
|
+
scheme.properties = {
|
|
371
|
+
"style": {
|
|
372
|
+
"description": "Code fence syle",
|
|
373
|
+
"type": "string",
|
|
374
|
+
"enum": [
|
|
375
|
+
"consistent",
|
|
376
|
+
"backtick",
|
|
377
|
+
"tilde"
|
|
378
|
+
],
|
|
379
|
+
"default": "consistent"
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
break;
|
|
383
|
+
default:
|
|
384
|
+
custom = false;
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
if (custom) {
|
|
388
|
+
// @ts-ignore
|
|
389
|
+
scheme.type = [ "boolean", "object" ];
|
|
390
|
+
scheme.additionalProperties = false;
|
|
391
|
+
}
|
|
392
|
+
rule.names.forEach(function forName(name) {
|
|
393
|
+
schema.properties[name] = scheme;
|
|
394
|
+
});
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// Add tags
|
|
398
|
+
Object.keys(tags).forEach(function forTag(tag) {
|
|
399
|
+
const scheme = {
|
|
400
|
+
"description": tag + " - " + tags[tag].join(", "),
|
|
401
|
+
"type": "boolean",
|
|
402
|
+
"default": true
|
|
403
|
+
};
|
|
404
|
+
schema.properties[tag] = scheme;
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
// Write schema
|
|
408
|
+
const schemaFile = path.join(__dirname, "markdownlint-config-schema.json");
|
|
409
|
+
fs.writeFileSync(schemaFile, JSON.stringify(schema, null, " "));
|