markdownlint 0.33.0 → 0.35.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/CONTRIBUTING.md +4 -3
  3. package/README.md +25 -10
  4. package/demo/markdownlint-browser.js +3286 -2119
  5. package/doc/CustomRules.md +25 -13
  6. package/doc/Rules.md +106 -7
  7. package/doc/md013.md +8 -7
  8. package/doc/md034.md +5 -0
  9. package/doc/md044.md +10 -0
  10. package/doc/md049.md +3 -0
  11. package/doc/md050.md +3 -0
  12. package/doc/md051.md +26 -0
  13. package/doc/md058.md +48 -0
  14. package/helpers/README.md +3 -27
  15. package/helpers/helpers.js +60 -292
  16. package/helpers/micromark.cjs +153 -36
  17. package/helpers/package.json +2 -2
  18. package/lib/cache.js +62 -13
  19. package/lib/configuration-strict.d.ts +1185 -0
  20. package/lib/configuration.d.ts +3 -1173
  21. package/lib/constants.js +3 -2
  22. package/lib/markdownlint.d.ts +143 -61
  23. package/lib/markdownlint.js +151 -54
  24. package/lib/md001.js +17 -8
  25. package/lib/md003.js +16 -8
  26. package/lib/md004.js +57 -47
  27. package/lib/md005.js +7 -8
  28. package/lib/md007.js +13 -12
  29. package/lib/md009.js +52 -43
  30. package/lib/md010.js +50 -32
  31. package/lib/md011.js +18 -7
  32. package/lib/md012.js +19 -8
  33. package/lib/md013.js +46 -37
  34. package/lib/md014.js +37 -36
  35. package/lib/md018.js +20 -8
  36. package/lib/md019-md021.js +80 -0
  37. package/lib/md020.js +15 -6
  38. package/lib/md022.js +10 -12
  39. package/lib/md023.js +24 -22
  40. package/lib/md024.js +14 -8
  41. package/lib/md025.js +17 -9
  42. package/lib/md026.js +5 -6
  43. package/lib/md027.js +24 -43
  44. package/lib/md028.js +26 -14
  45. package/lib/md029.js +42 -33
  46. package/lib/md030.js +7 -8
  47. package/lib/md031.js +45 -22
  48. package/lib/md032.js +18 -30
  49. package/lib/md033.js +6 -4
  50. package/lib/md034.js +30 -9
  51. package/lib/md035.js +5 -3
  52. package/lib/md036.js +34 -39
  53. package/lib/md037.js +3 -0
  54. package/lib/md038.js +6 -5
  55. package/lib/md039.js +68 -52
  56. package/lib/md040.js +21 -21
  57. package/lib/md041.js +21 -26
  58. package/lib/md042.js +50 -36
  59. package/lib/md043.js +22 -13
  60. package/lib/md044.js +5 -2
  61. package/lib/md045.js +6 -4
  62. package/lib/md046.js +9 -8
  63. package/lib/md047.js +5 -2
  64. package/lib/md048.js +22 -13
  65. package/lib/md049-md050.js +19 -5
  66. package/lib/md051.js +18 -20
  67. package/lib/md052.js +5 -2
  68. package/lib/md053.js +5 -2
  69. package/lib/md054.js +12 -12
  70. package/lib/md055.js +10 -3
  71. package/lib/md056.js +18 -6
  72. package/lib/md058.js +43 -0
  73. package/lib/rules.js +11 -4
  74. package/package.json +22 -25
  75. package/schema/.markdownlint.jsonc +54 -51
  76. package/schema/.markdownlint.yaml +53 -50
  77. package/schema/ValidatingConfiguration.md +6 -8
  78. package/schema/markdownlint-config-schema-strict.json +1819 -0
  79. package/schema/markdownlint-config-schema.json +115 -105
  80. package/style/prettier.json +1 -0
  81. package/lib/md019.js +0 -39
  82. package/lib/md021.js +0 -62
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.35.0
4
+
5
+ - Add MD058/blanks-around-tables
6
+ - Use `micromark` in MD001/MD003/MD009/MD010/MD013/MD014/MD019/MD021/MD023/
7
+ MD024/MD025/MD039/MD042/MD043
8
+ - Improve MD018/MD020/MD031/MD034/MD044
9
+ - `markdown-it` parser no longer invoked by default
10
+ - Add strict version of JSON schema
11
+ - Improve performance
12
+ - Update dependencies
13
+
14
+ ## 0.34.0
15
+
16
+ - Use `micromark` in MD027/MD028/MD036/MD040/MD041/MD046/MD048
17
+ - Improve MD013/MD034/MD049/MD050/MD051
18
+ - Update custom rule requirements and documentation
19
+ - Improve various TypeScript declarations
20
+ - Update dependencies
21
+
3
22
  ## 0.33.0
4
23
 
5
24
  - Add MD055/table-pipe-style, MD056/table-column-count
package/CONTRIBUTING.md CHANGED
@@ -19,8 +19,9 @@ project's only dependencies.
19
19
 
20
20
  Package versions for `dependencies` and `devDependencies` should be specified
21
21
  exactly (also known as "pinning"). The short explanation is that doing otherwise
22
- eventually leads to inconsistent behavior and broken functionality. (See [Pin
23
- your npm/yarn dependencies][pin-dependencies] for a longer explanation.)
22
+ eventually leads to inconsistent behavior and broken functionality. (See [Why I
23
+ pin dependency versions in Node.js packages][version-pinning] for a longer
24
+ explanation.)
24
25
 
25
26
  If developing a new rule, start by creating a [custom rule][custom-rules] in its
26
27
  own project. Once written, published, and tested in real world scenarios, open
@@ -88,5 +89,5 @@ Thank you!
88
89
  [micromark]: https://www.npmjs.com/package/micromark
89
90
  [new-rule]: https://github.com/DavidAnson/markdownlint/labels/new%20rule
90
91
  [npm-scripts]: https://docs.npmjs.com/misc/scripts
91
- [pin-dependencies]: https://maxleiter.com/blog/pin-dependencies
92
92
  [rewriting-history]: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
93
+ [version-pinning]: https://dlaa.me/blog/post/versionpinning
package/README.md CHANGED
@@ -136,6 +136,7 @@ playground for learning and exploring.
136
136
  - **[MD054](doc/md054.md)** *link-image-style* - Link and image style
137
137
  - **[MD055](doc/md055.md)** *table-pipe-style* - Table pipe style
138
138
  - **[MD056](doc/md056.md)** *table-column-count* - Table column count
139
+ - **[MD058](doc/md058.md)** *blanks-around-tables* - Tables should be surrounded by blank lines
139
140
 
140
141
  <!-- markdownlint-restore -->
141
142
 
@@ -177,7 +178,7 @@ rules at once.
177
178
  - **`ol`** - `MD029`, `MD030`, `MD032`
178
179
  - **`spaces`** - `MD018`, `MD019`, `MD020`, `MD021`, `MD023`
179
180
  - **`spelling`** - `MD044`
180
- - **`table`** - `MD055`, `MD056`
181
+ - **`table`** - `MD055`, `MD056`, `MD058`
181
182
  - **`ul`** - `MD004`, `MD005`, `MD007`, `MD030`, `MD032`
182
183
  - **`url`** - `MD034`
183
184
  - **`whitespace`** - `MD009`, `MD010`, `MD012`, `MD027`, `MD028`, `MD030`,
@@ -353,16 +354,16 @@ Type: `Object` mapping `String` to `Boolean | Object`
353
354
 
354
355
  Configures the rules to use.
355
356
 
356
- Object keys are rule names or aliases and values are the rule's configuration.
357
+ Object keys are rule names/aliases; object values are the rule's configuration.
357
358
  The value `false` disables a rule, `true` enables its default configuration,
358
- and passing an object customizes its settings. Setting the special `default`
359
- rule to `true` or `false` includes/excludes all rules by default. Enabling
360
- or disabling a tag name (ex: `whitespace`) affects all rules having that
361
- tag.
359
+ and passing an object value customizes that rule. Setting the special `default`
360
+ rule to `true` or `false` includes/excludes all rules by default. In the absence
361
+ of a configuration object, all rules are enabled. Enabling or disabling a tag
362
+ name (ex: `whitespace`) affects all rules having that tag.
362
363
 
363
- The `default` rule is applied first, then keys are processed in order
364
- from top to bottom with later values overriding earlier ones. Keys
365
- (including rule names, aliases, tags, and `default`) are not case-sensitive.
364
+ The `default` rule is applied first, then keys are processed in order from top
365
+ to bottom with later values overriding earlier ones. Keys (including rule names,
366
+ aliases, tags, and `default`) are not case-sensitive.
366
367
 
367
368
  Example:
368
369
 
@@ -562,7 +563,7 @@ is allowed to continue and report any violations that were found.
562
563
 
563
564
  Type: `Array` of `Array` of `Function` and plugin parameters
564
565
 
565
- Specifies additional [markdown-it plugins][markdown-it-plugin] to use when
566
+ Specifies additional [`markdown-it` plugins][markdown-it-plugin] to use when
566
567
  parsing input. Plugins can be used to support additional syntax and features for
567
568
  advanced scenarios.
568
569
 
@@ -574,6 +575,13 @@ Each item in the top-level `Array` should be of the form:
574
575
  [ require("markdown-it-plugin"), plugin_param_0, plugin_param_1, ... ]
575
576
  ```
576
577
 
578
+ > Note that `markdown-it` plugins are only called when the `markdown-it` parser
579
+ > is invoked. None of the built-in rules use the `markdown-it` parser, so
580
+ > `markdown-it` plugins will only be invoked when one or more
581
+ > [custom rules][custom-rules] that use the `markdown-it` parser are present.
582
+
583
+ [custom-rules]: #custom-rules
584
+
577
585
  ##### options.noInlineConfig
578
586
 
579
587
  Type: `Boolean`
@@ -979,6 +987,11 @@ following projects or one of the tools in the [Related section](#related):
979
987
  - [webpack][webpack] ([Search repository][webpack-search])
980
988
  - [WordPress][wordpress] ([Search repository][wordpress-search])
981
989
 
990
+ For more advanced integration scenarios:
991
+
992
+ - [GitHub Docs content linter][content-linter]
993
+ - [GitHub's `markdownlint-github` repository][markdownlint-github]
994
+
982
995
  [ally-js]: https://allyjs.io/
983
996
  [ally-js-search]: https://github.com/medialize/ally.js/search?q=markdownlint
984
997
  [airflow]: https://airflow.apache.org
@@ -987,6 +1000,7 @@ following projects or one of the tools in the [Related section](#related):
987
1000
  [boostnote-search]: https://github.com/BoostIO/Boostnote/search?q=markdownlint
988
1001
  [codimd]: https://github.com/hackmdio/codimd
989
1002
  [codimd-search]: https://github.com/hackmdio/codimd/search?q=markdownlint
1003
+ [content-linter]: https://docs.github.com/en/contributing/collaborating-on-github-docs/using-the-content-linter
990
1004
  [dot-net-doc]: https://docs.microsoft.com/en-us/dotnet/
991
1005
  [dot-net-doc-search]: https://github.com/dotnet/docs/search?q=markdownlint
992
1006
  [electron]: https://www.electronjs.org
@@ -995,6 +1009,7 @@ following projects or one of the tools in the [Related section](#related):
995
1009
  [eslint-search]: https://github.com/eslint/eslint/search?q=markdownlint
996
1010
  [garden]: https://zendeskgarden.github.io/react-components/
997
1011
  [garden-search]: https://github.com/zendeskgarden/react-components/search?q=markdownlint
1012
+ [markdownlint-github]: https://github.com/github/markdownlint-github
998
1013
  [mdn]: https://developer.mozilla.org/
999
1014
  [mdn-search]: https://github.com/mdn/content/search?q=markdownlint
1000
1015
  [mkdocs]: https://www.mkdocs.org/