markdownlint 0.12.0 → 0.14.2

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.
Files changed (61) hide show
  1. package/.eslintrc.json +52 -275
  2. package/.travis.yml +2 -2
  3. package/LICENSE +1 -1
  4. package/README.md +54 -27
  5. package/doc/CustomRules.md +7 -2
  6. package/doc/Rules.md +120 -33
  7. package/example/standalone.js +2 -2
  8. package/helpers/LICENSE +21 -0
  9. package/helpers/README.md +50 -0
  10. package/{lib/shared.js → helpers/helpers.js} +91 -82
  11. package/helpers/package.json +18 -0
  12. package/lib/cache.js +24 -0
  13. package/lib/markdownlint.js +78 -45
  14. package/lib/md001.js +3 -3
  15. package/lib/md002.js +2 -2
  16. package/lib/md003.js +5 -4
  17. package/lib/md004.js +11 -9
  18. package/lib/md005.js +12 -10
  19. package/lib/md006.js +7 -5
  20. package/lib/md007.js +7 -5
  21. package/lib/md009.js +10 -8
  22. package/lib/md010.js +5 -5
  23. package/lib/md011.js +4 -4
  24. package/lib/md012.js +4 -3
  25. package/lib/md013.js +41 -32
  26. package/lib/md014.js +7 -6
  27. package/lib/md018.js +6 -4
  28. package/lib/md019.js +6 -5
  29. package/lib/md020.js +5 -4
  30. package/lib/md021.js +6 -5
  31. package/lib/md022.js +22 -22
  32. package/lib/md023.js +5 -4
  33. package/lib/md024.js +6 -6
  34. package/lib/md025.js +11 -5
  35. package/lib/md026.js +4 -4
  36. package/lib/md027.js +6 -6
  37. package/lib/md028.js +2 -2
  38. package/lib/md029.js +17 -9
  39. package/lib/md030.js +8 -6
  40. package/lib/md031.js +7 -6
  41. package/lib/md032.js +10 -12
  42. package/lib/md033.js +27 -26
  43. package/lib/md034.js +15 -10
  44. package/lib/md035.js +3 -3
  45. package/lib/md036.js +2 -2
  46. package/lib/md037.js +12 -9
  47. package/lib/md038.js +6 -5
  48. package/lib/md039.js +7 -6
  49. package/lib/md040.js +3 -3
  50. package/lib/md041.js +17 -19
  51. package/lib/md042.js +5 -4
  52. package/lib/md043.js +5 -4
  53. package/lib/md044.js +14 -13
  54. package/lib/md045.js +3 -3
  55. package/lib/md046.js +32 -0
  56. package/lib/md047.js +18 -0
  57. package/lib/rules.js +3 -1
  58. package/package.json +12 -11
  59. package/schema/build-config-schema.js +36 -2
  60. package/schema/markdownlint-config-schema.json +178 -14
  61. package/style/cirosantilli.json +1 -1
@@ -374,6 +374,11 @@
374
374
  "type": "integer",
375
375
  "default": 80
376
376
  },
377
+ "heading_line_length": {
378
+ "description": "Number of characters for headings",
379
+ "type": "integer",
380
+ "default": 80
381
+ },
377
382
  "code_blocks": {
378
383
  "description": "Include code blocks",
379
384
  "type": "boolean",
@@ -410,6 +415,11 @@
410
415
  "type": "integer",
411
416
  "default": 80
412
417
  },
418
+ "heading_line_length": {
419
+ "description": "Number of characters for headings",
420
+ "type": "integer",
421
+ "default": 80
422
+ },
413
423
  "code_blocks": {
414
424
  "description": "Include code blocks",
415
425
  "type": "boolean",
@@ -485,18 +495,66 @@
485
495
  },
486
496
  "MD022": {
487
497
  "description": "MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines",
488
- "type": "boolean",
489
- "default": true
498
+ "type": [
499
+ "boolean",
500
+ "object"
501
+ ],
502
+ "default": true,
503
+ "properties": {
504
+ "lines_above": {
505
+ "description": "Blank lines above heading",
506
+ "type": "integer",
507
+ "default": 1
508
+ },
509
+ "lines_below": {
510
+ "description": "Blank lines below heading",
511
+ "type": "integer",
512
+ "default": 1
513
+ }
514
+ },
515
+ "additionalProperties": false
490
516
  },
491
517
  "blanks-around-headings": {
492
518
  "description": "MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines",
493
- "type": "boolean",
494
- "default": true
519
+ "type": [
520
+ "boolean",
521
+ "object"
522
+ ],
523
+ "default": true,
524
+ "properties": {
525
+ "lines_above": {
526
+ "description": "Blank lines above heading",
527
+ "type": "integer",
528
+ "default": 1
529
+ },
530
+ "lines_below": {
531
+ "description": "Blank lines below heading",
532
+ "type": "integer",
533
+ "default": 1
534
+ }
535
+ },
536
+ "additionalProperties": false
495
537
  },
496
538
  "blanks-around-headers": {
497
539
  "description": "MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines",
498
- "type": "boolean",
499
- "default": true
540
+ "type": [
541
+ "boolean",
542
+ "object"
543
+ ],
544
+ "default": true,
545
+ "properties": {
546
+ "lines_above": {
547
+ "description": "Blank lines above heading",
548
+ "type": "integer",
549
+ "default": 1
550
+ },
551
+ "lines_below": {
552
+ "description": "Blank lines below heading",
553
+ "type": "integer",
554
+ "default": 1
555
+ }
556
+ },
557
+ "additionalProperties": false
500
558
  },
501
559
  "MD023": {
502
560
  "description": "MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line",
@@ -577,7 +635,28 @@
577
635
  "additionalProperties": false
578
636
  },
579
637
  "MD025": {
580
- "description": "MD025/single-h1 - Multiple top level headings in the same document",
638
+ "description": "MD025/single-title/single-h1 - Multiple top level headings in the same document",
639
+ "type": [
640
+ "boolean",
641
+ "object"
642
+ ],
643
+ "default": true,
644
+ "properties": {
645
+ "level": {
646
+ "description": "Heading level",
647
+ "type": "integer",
648
+ "default": 1
649
+ },
650
+ "front_matter_title": {
651
+ "description": "RegExp for matching title in front matter",
652
+ "type": "string",
653
+ "default": "^\\s*title\\s*[:=]"
654
+ }
655
+ },
656
+ "additionalProperties": false
657
+ },
658
+ "single-title": {
659
+ "description": "MD025/single-title/single-h1 - Multiple top level headings in the same document",
581
660
  "type": [
582
661
  "boolean",
583
662
  "object"
@@ -588,12 +667,17 @@
588
667
  "description": "Heading level",
589
668
  "type": "integer",
590
669
  "default": 1
670
+ },
671
+ "front_matter_title": {
672
+ "description": "RegExp for matching title in front matter",
673
+ "type": "string",
674
+ "default": "^\\s*title\\s*[:=]"
591
675
  }
592
676
  },
593
677
  "additionalProperties": false
594
678
  },
595
679
  "single-h1": {
596
- "description": "MD025/single-h1 - Multiple top level headings in the same document",
680
+ "description": "MD025/single-title/single-h1 - Multiple top level headings in the same document",
597
681
  "type": [
598
682
  "boolean",
599
683
  "object"
@@ -604,6 +688,11 @@
604
688
  "description": "Heading level",
605
689
  "type": "integer",
606
690
  "default": 1
691
+ },
692
+ "front_matter_title": {
693
+ "description": "RegExp for matching title in front matter",
694
+ "type": "string",
695
+ "default": "^\\s*title\\s*[:=]"
607
696
  }
608
697
  },
609
698
  "additionalProperties": false
@@ -674,7 +763,8 @@
674
763
  "enum": [
675
764
  "one",
676
765
  "ordered",
677
- "one_or_ordered"
766
+ "one_or_ordered",
767
+ "zero"
678
768
  ],
679
769
  "default": "one_or_ordered"
680
770
  }
@@ -695,7 +785,8 @@
695
785
  "enum": [
696
786
  "one",
697
787
  "ordered",
698
- "one_or_ordered"
788
+ "one_or_ordered",
789
+ "zero"
699
790
  ],
700
791
  "default": "one_or_ordered"
701
792
  }
@@ -953,7 +1044,28 @@
953
1044
  "default": true
954
1045
  },
955
1046
  "MD041": {
956
- "description": "MD041/first-line-h1 - First line in file should be a top level heading",
1047
+ "description": "MD041/first-line-heading/first-line-h1 - First line in file should be a top level heading",
1048
+ "type": [
1049
+ "boolean",
1050
+ "object"
1051
+ ],
1052
+ "default": true,
1053
+ "properties": {
1054
+ "level": {
1055
+ "description": "Heading level",
1056
+ "type": "integer",
1057
+ "default": 1
1058
+ },
1059
+ "front_matter_title": {
1060
+ "description": "RegExp for matching title in front matter",
1061
+ "type": "string",
1062
+ "default": "^\\s*title\\s*[:=]"
1063
+ }
1064
+ },
1065
+ "additionalProperties": false
1066
+ },
1067
+ "first-line-heading": {
1068
+ "description": "MD041/first-line-heading/first-line-h1 - First line in file should be a top level heading",
957
1069
  "type": [
958
1070
  "boolean",
959
1071
  "object"
@@ -974,7 +1086,7 @@
974
1086
  "additionalProperties": false
975
1087
  },
976
1088
  "first-line-h1": {
977
- "description": "MD041/first-line-h1 - First line in file should be a top level heading",
1089
+ "description": "MD041/first-line-heading/first-line-h1 - First line in file should be a top level heading",
978
1090
  "type": [
979
1091
  "boolean",
980
1092
  "object"
@@ -1143,6 +1255,58 @@
1143
1255
  "type": "boolean",
1144
1256
  "default": true
1145
1257
  },
1258
+ "MD046": {
1259
+ "description": "MD046/code-block-style - Code block style",
1260
+ "type": [
1261
+ "boolean",
1262
+ "object"
1263
+ ],
1264
+ "default": true,
1265
+ "properties": {
1266
+ "style": {
1267
+ "description": "Block style",
1268
+ "type": "string",
1269
+ "enum": [
1270
+ "consistent",
1271
+ "fenced",
1272
+ "indented"
1273
+ ],
1274
+ "default": "consistent"
1275
+ }
1276
+ },
1277
+ "additionalProperties": false
1278
+ },
1279
+ "code-block-style": {
1280
+ "description": "MD046/code-block-style - Code block style",
1281
+ "type": [
1282
+ "boolean",
1283
+ "object"
1284
+ ],
1285
+ "default": true,
1286
+ "properties": {
1287
+ "style": {
1288
+ "description": "Block style",
1289
+ "type": "string",
1290
+ "enum": [
1291
+ "consistent",
1292
+ "fenced",
1293
+ "indented"
1294
+ ],
1295
+ "default": "consistent"
1296
+ }
1297
+ },
1298
+ "additionalProperties": false
1299
+ },
1300
+ "MD047": {
1301
+ "description": "MD047/single-trailing-newline - Files should end with a single newline character",
1302
+ "type": "boolean",
1303
+ "default": true
1304
+ },
1305
+ "single-trailing-newline": {
1306
+ "description": "MD047/single-trailing-newline - Files should end with a single newline character",
1307
+ "type": "boolean",
1308
+ "default": true
1309
+ },
1146
1310
  "headings": {
1147
1311
  "description": "headings - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
1148
1312
  "type": "boolean",
@@ -1184,7 +1348,7 @@
1184
1348
  "default": true
1185
1349
  },
1186
1350
  "blank_lines": {
1187
- "description": "blank_lines - MD012, MD022, MD031, MD032",
1351
+ "description": "blank_lines - MD012, MD022, MD031, MD032, MD047",
1188
1352
  "type": "boolean",
1189
1353
  "default": true
1190
1354
  },
@@ -1194,7 +1358,7 @@
1194
1358
  "default": true
1195
1359
  },
1196
1360
  "code": {
1197
- "description": "code - MD014, MD031, MD038, MD040",
1361
+ "description": "code - MD014, MD031, MD038, MD040, MD046",
1198
1362
  "type": "boolean",
1199
1363
  "default": true
1200
1364
  },
@@ -1,5 +1,5 @@
1
1
  {
2
- "comment": "Rules for the style guide at http://www.cirosantilli.com/markdown-style-guide/",
2
+ "comment": "Rules for the style guide at https://www.cirosantilli.com/markdown-style-guide/",
3
3
 
4
4
  "default": true,
5
5
  "MD003": {