markdownlint 0.21.1 → 0.24.0

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.
@@ -9,7 +9,10 @@
9
9
  },
10
10
  "extends": {
11
11
  "description": "Path to configuration file to extend",
12
- "type": "string",
12
+ "type": [
13
+ "string",
14
+ "null"
15
+ ],
13
16
  "default": null
14
17
  },
15
18
  "$schema": {
@@ -33,7 +36,7 @@
33
36
  "default": true
34
37
  },
35
38
  "MD002": {
36
- "description": "MD002/first-heading-h1/first-header-h1 - First heading should be a top level heading",
39
+ "description": "MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading",
37
40
  "type": [
38
41
  "boolean",
39
42
  "object"
@@ -49,7 +52,7 @@
49
52
  "additionalProperties": false
50
53
  },
51
54
  "first-heading-h1": {
52
- "description": "MD002/first-heading-h1/first-header-h1 - First heading should be a top level heading",
55
+ "description": "MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading",
53
56
  "type": [
54
57
  "boolean",
55
58
  "object"
@@ -65,7 +68,7 @@
65
68
  "additionalProperties": false
66
69
  },
67
70
  "first-header-h1": {
68
- "description": "MD002/first-heading-h1/first-header-h1 - First heading should be a top level heading",
71
+ "description": "MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading",
69
72
  "type": [
70
73
  "boolean",
71
74
  "object"
@@ -324,6 +327,11 @@
324
327
  "description": "Include code blocks",
325
328
  "type": "boolean",
326
329
  "default": true
330
+ },
331
+ "spaces_per_tab": {
332
+ "description": "Number of spaces for each hard tab",
333
+ "type": "number",
334
+ "default": 1
327
335
  }
328
336
  },
329
337
  "additionalProperties": false
@@ -340,6 +348,11 @@
340
348
  "description": "Include code blocks",
341
349
  "type": "boolean",
342
350
  "default": true
351
+ },
352
+ "spaces_per_tab": {
353
+ "description": "Number of spaces for each hard tab",
354
+ "type": "number",
355
+ "default": 1
343
356
  }
344
357
  },
345
358
  "additionalProperties": false
@@ -690,7 +703,7 @@
690
703
  "additionalProperties": false
691
704
  },
692
705
  "MD025": {
693
- "description": "MD025/single-title/single-h1 - Multiple top level headings in the same document",
706
+ "description": "MD025/single-title/single-h1 - Multiple top-level headings in the same document",
694
707
  "type": [
695
708
  "boolean",
696
709
  "object"
@@ -711,7 +724,7 @@
711
724
  "additionalProperties": false
712
725
  },
713
726
  "single-title": {
714
- "description": "MD025/single-title/single-h1 - Multiple top level headings in the same document",
727
+ "description": "MD025/single-title/single-h1 - Multiple top-level headings in the same document",
715
728
  "type": [
716
729
  "boolean",
717
730
  "object"
@@ -732,7 +745,7 @@
732
745
  "additionalProperties": false
733
746
  },
734
747
  "single-h1": {
735
- "description": "MD025/single-title/single-h1 - Multiple top level headings in the same document",
748
+ "description": "MD025/single-title/single-h1 - Multiple top-level headings in the same document",
736
749
  "type": [
737
750
  "boolean",
738
751
  "object"
@@ -763,7 +776,7 @@
763
776
  "punctuation": {
764
777
  "description": "Punctuation characters",
765
778
  "type": "string",
766
- "default": ".,;:!?。,;:!?"
779
+ "default": ".,;:!。,;:!"
767
780
  }
768
781
  },
769
782
  "additionalProperties": false
@@ -779,7 +792,7 @@
779
792
  "punctuation": {
780
793
  "description": "Punctuation characters",
781
794
  "type": "string",
782
- "default": ".,;:!?。,;:!?"
795
+ "default": ".,;:!。,;:!"
783
796
  }
784
797
  },
785
798
  "additionalProperties": false
@@ -1121,7 +1134,7 @@
1121
1134
  "default": true
1122
1135
  },
1123
1136
  "MD041": {
1124
- "description": "MD041/first-line-heading/first-line-h1 - First line in file should be a top level heading",
1137
+ "description": "MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading",
1125
1138
  "type": [
1126
1139
  "boolean",
1127
1140
  "object"
@@ -1142,7 +1155,7 @@
1142
1155
  "additionalProperties": false
1143
1156
  },
1144
1157
  "first-line-heading": {
1145
- "description": "MD041/first-line-heading/first-line-h1 - First line in file should be a top level heading",
1158
+ "description": "MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading",
1146
1159
  "type": [
1147
1160
  "boolean",
1148
1161
  "object"
@@ -1163,7 +1176,7 @@
1163
1176
  "additionalProperties": false
1164
1177
  },
1165
1178
  "first-line-h1": {
1166
- "description": "MD041/first-line-heading/first-line-h1 - First line in file should be a top level heading",
1179
+ "description": "MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading",
1167
1180
  "type": [
1168
1181
  "boolean",
1169
1182
  "object"
@@ -1207,7 +1220,7 @@
1207
1220
  "items": {
1208
1221
  "type": "string"
1209
1222
  },
1210
- "default": null
1223
+ "default": []
1211
1224
  },
1212
1225
  "headers": {
1213
1226
  "description": "List of headings",
@@ -1215,7 +1228,7 @@
1215
1228
  "items": {
1216
1229
  "type": "string"
1217
1230
  },
1218
- "default": null
1231
+ "default": []
1219
1232
  }
1220
1233
  },
1221
1234
  "additionalProperties": false
@@ -1234,7 +1247,7 @@
1234
1247
  "items": {
1235
1248
  "type": "string"
1236
1249
  },
1237
- "default": null
1250
+ "default": []
1238
1251
  },
1239
1252
  "headers": {
1240
1253
  "description": "List of headings",
@@ -1242,7 +1255,7 @@
1242
1255
  "items": {
1243
1256
  "type": "string"
1244
1257
  },
1245
- "default": null
1258
+ "default": []
1246
1259
  }
1247
1260
  },
1248
1261
  "additionalProperties": false
@@ -1261,7 +1274,7 @@
1261
1274
  "items": {
1262
1275
  "type": "string"
1263
1276
  },
1264
- "default": null
1277
+ "default": []
1265
1278
  },
1266
1279
  "headers": {
1267
1280
  "description": "List of headings",
@@ -1269,7 +1282,7 @@
1269
1282
  "items": {
1270
1283
  "type": "string"
1271
1284
  },
1272
- "default": null
1285
+ "default": []
1273
1286
  }
1274
1287
  },
1275
1288
  "additionalProperties": false
@@ -1288,7 +1301,7 @@
1288
1301
  "items": {
1289
1302
  "type": "string"
1290
1303
  },
1291
- "default": null
1304
+ "default": []
1292
1305
  },
1293
1306
  "code_blocks": {
1294
1307
  "description": "Include code blocks",
@@ -1312,7 +1325,7 @@
1312
1325
  "items": {
1313
1326
  "type": "string"
1314
1327
  },
1315
- "default": null
1328
+ "default": []
1316
1329
  },
1317
1330
  "code_blocks": {
1318
1331
  "description": "Include code blocks",
@@ -1393,7 +1406,7 @@
1393
1406
  "default": true,
1394
1407
  "properties": {
1395
1408
  "style": {
1396
- "description": "Code fence syle",
1409
+ "description": "Code fence style",
1397
1410
  "type": "string",
1398
1411
  "enum": [
1399
1412
  "consistent",
@@ -1414,7 +1427,7 @@
1414
1427
  "default": true,
1415
1428
  "properties": {
1416
1429
  "style": {
1417
- "description": "Code fence syle",
1430
+ "description": "Code fence style",
1418
1431
  "type": "string",
1419
1432
  "enum": [
1420
1433
  "consistent",
@@ -1548,7 +1561,7 @@
1548
1561
  }
1549
1562
  },
1550
1563
  "additionalProperties": {
1551
- "type:": [
1564
+ "type": [
1552
1565
  "boolean",
1553
1566
  "object"
1554
1567
  ]
@@ -1,409 +0,0 @@
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, " "));