markdownlint 0.41.0 → 0.42.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 (66) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/CONTRIBUTING.md +62 -77
  3. package/README.md +7 -7
  4. package/doc/CustomRules.md +6 -4
  5. package/doc/Rules.md +87 -36
  6. package/doc/md010.md +0 -1
  7. package/doc/md024.md +1 -1
  8. package/doc/md029.md +11 -1
  9. package/doc/md043.md +47 -9
  10. package/doc/md051.md +19 -19
  11. package/doc/md055.md +6 -3
  12. package/doc/md060.md +3 -2
  13. package/helpers/README.md +2 -2
  14. package/helpers/helpers.cjs +23 -7
  15. package/helpers/micromark-helpers.cjs +8 -12
  16. package/helpers/package.json +1 -5
  17. package/helpers/shared.cjs +1 -1
  18. package/lib/cache.mjs +1 -0
  19. package/lib/configuration-strict.d.ts +124 -112
  20. package/lib/constants.mjs +1 -1
  21. package/lib/defer-require.cjs +1 -0
  22. package/lib/exports.d.mts +29 -1
  23. package/lib/markdownit.cjs +8 -1
  24. package/lib/markdownlint.d.mts +337 -195
  25. package/lib/markdownlint.mjs +83 -87
  26. package/lib/md004.mjs +1 -0
  27. package/lib/md005.mjs +1 -1
  28. package/lib/md007.mjs +2 -2
  29. package/lib/md009.mjs +2 -3
  30. package/lib/md010.mjs +1 -1
  31. package/lib/md011.mjs +10 -7
  32. package/lib/md012.mjs +1 -1
  33. package/lib/md013.mjs +13 -9
  34. package/lib/md018.mjs +1 -1
  35. package/lib/md019-md021.mjs +1 -0
  36. package/lib/md020.mjs +1 -1
  37. package/lib/md022.mjs +6 -6
  38. package/lib/md024.mjs +1 -1
  39. package/lib/md025.mjs +1 -1
  40. package/lib/md027.mjs +1 -1
  41. package/lib/md028.mjs +1 -2
  42. package/lib/md029.mjs +34 -23
  43. package/lib/md030.mjs +4 -4
  44. package/lib/md031.mjs +1 -1
  45. package/lib/md032.mjs +5 -4
  46. package/lib/md033.mjs +1 -1
  47. package/lib/md034.mjs +1 -1
  48. package/lib/md037.mjs +1 -2
  49. package/lib/md039.mjs +5 -1
  50. package/lib/md041.mjs +1 -1
  51. package/lib/md043.mjs +98 -44
  52. package/lib/md044.mjs +2 -2
  53. package/lib/md048.mjs +1 -3
  54. package/lib/md051.mjs +3 -3
  55. package/lib/md055.mjs +11 -1
  56. package/lib/md056.mjs +1 -1
  57. package/lib/md058.mjs +1 -1
  58. package/lib/md060.mjs +24 -4
  59. package/lib/micromark-parse.mjs +3 -2
  60. package/lib/resolve-module.cjs +3 -2
  61. package/lib/resolve-module.d.cts +15 -10
  62. package/package.json +33 -34
  63. package/schema/.markdownlint.jsonc +54 -54
  64. package/schema/.markdownlint.yaml +76 -76
  65. package/schema/markdownlint-config-schema-strict.json +126 -118
  66. package/schema/markdownlint-config-schema.json +126 -118
package/lib/constants.mjs CHANGED
@@ -11,4 +11,4 @@ export const fixableRuleNames = [
11
11
  "MD054", "MD058", "MD060"
12
12
  ];
13
13
  export const homepage = "https://github.com/DavidAnson/markdownlint";
14
- export const version = "0.41.0";
14
+ export const version = "0.42.0";
@@ -10,6 +10,7 @@
10
10
  * @returns {any} Exported module content.
11
11
  */
12
12
  function requireMarkdownItCjs() {
13
+ // eslint-disable-next-line n/global-require
13
14
  return require("./markdownit.cjs");
14
15
  }
15
16
 
package/lib/exports.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ export { applyFix, applyFixes, getVersion } from "./markdownlint.mjs";
1
2
  export { resolveModule } from "./resolve-module.cjs";
2
3
  export type Configuration = import("./markdownlint.mjs").Configuration;
3
4
  export type ConfigurationParser = import("./markdownlint.mjs").ConfigurationParser;
@@ -27,4 +28,31 @@ export type RuleOnError = import("./markdownlint.mjs").RuleOnError;
27
28
  export type RuleOnErrorFixInfo = import("./markdownlint.mjs").RuleOnErrorFixInfo;
28
29
  export type RuleOnErrorInfo = import("./markdownlint.mjs").RuleOnErrorInfo;
29
30
  export type RuleParams = import("./markdownlint.mjs").RuleParams;
30
- export { applyFix, applyFixes, getVersion } from "./markdownlint.mjs";
31
+ /** @typedef {import("./markdownlint.mjs").Configuration} Configuration */
32
+ /** @typedef {import("./markdownlint.mjs").ConfigurationParser} ConfigurationParser */
33
+ /** @typedef {import("./markdownlint.mjs").ConfigurationStrict} ConfigurationStrict */
34
+ /** @typedef {import("./markdownlint.mjs").FixInfo} FixInfo */
35
+ /** @typedef {import("./markdownlint.mjs").FixInfoNormalized} FixInfoNormalized */
36
+ /** @typedef {import("./markdownlint.mjs").LintCallback} LintCallback */
37
+ /** @typedef {import("./markdownlint.mjs").LintContentCallback} LintContentCallback */
38
+ /** @typedef {import("./markdownlint.mjs").LintError} LintError */
39
+ /** @typedef {import("./markdownlint.mjs").LintResults} LintResults */
40
+ /** @typedef {import("./markdownlint.mjs").MarkdownItFactory} MarkdownItFactory */
41
+ /** @typedef {import("./markdownlint.mjs").MarkdownItBaseToken} MarkdownItBaseToken */
42
+ /** @typedef {import("./markdownlint.mjs").MarkdownItToken} MarkdownItToken */
43
+ /** @typedef {import("./markdownlint.mjs").MarkdownParsers} MarkdownParsers */
44
+ /** @typedef {import("./markdownlint.mjs").MicromarkToken} MicromarkToken */
45
+ /** @typedef {import("./markdownlint.mjs").MicromarkTokenType} MicromarkTokenType */
46
+ /** @typedef {import("./markdownlint.mjs").Options} Options */
47
+ /** @typedef {import("./markdownlint.mjs").ParserMarkdownIt} ParserMarkdownIt */
48
+ /** @typedef {import("./markdownlint.mjs").ParserMicromark} ParserMicromark */
49
+ /** @typedef {import("./markdownlint.mjs").Plugin} Plugin */
50
+ /** @typedef {import("./markdownlint.mjs").ReadConfigCallback} ReadConfigCallback */
51
+ /** @typedef {import("./markdownlint.mjs").ResolveConfigExtendsCallback} ResolveConfigExtendsCallback */
52
+ /** @typedef {import("./markdownlint.mjs").Rule} Rule */
53
+ /** @typedef {import("./markdownlint.mjs").RuleConfiguration} RuleConfiguration */
54
+ /** @typedef {import("./markdownlint.mjs").RuleFunction} RuleFunction */
55
+ /** @typedef {import("./markdownlint.mjs").RuleOnError} RuleOnError */
56
+ /** @typedef {import("./markdownlint.mjs").RuleOnErrorFixInfo} RuleOnErrorFixInfo */
57
+ /** @typedef {import("./markdownlint.mjs").RuleOnErrorInfo} RuleOnErrorInfo */
58
+ /** @typedef {import("./markdownlint.mjs").RuleParams} RuleParams */
@@ -92,6 +92,13 @@ function freezeToken(token) {
92
92
  if (token.map) {
93
93
  Object.freeze(token.map);
94
94
  }
95
+ if (token.meta) {
96
+ // eslint-disable-next-line guard-for-in
97
+ for (const meta in token.meta) {
98
+ Object.freeze(meta);
99
+ }
100
+ Object.freeze(token.meta);
101
+ }
95
102
  Object.freeze(token);
96
103
  }
97
104
 
@@ -114,7 +121,7 @@ function annotateAndFreezeTokens(tokens, lines) {
114
121
  } else if (token.type === "tr_close") {
115
122
  trMap = null;
116
123
  }
117
- if (!token.map && trMap) {
124
+ if (trMap && !token.map) {
118
125
  token.map = [ ...trMap ];
119
126
  }
120
127
  // Update token metadata