markdownlint 0.24.0 → 0.26.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 (51) hide show
  1. package/CONTRIBUTING.md +15 -3
  2. package/LICENSE +1 -1
  3. package/README.md +138 -87
  4. package/demo/markdownlint-browser.js +2028 -1364
  5. package/doc/CustomRules.md +15 -4
  6. package/doc/Rules.md +217 -26
  7. package/helpers/LICENSE +1 -1
  8. package/helpers/helpers.js +541 -188
  9. package/helpers/package.json +4 -1
  10. package/lib/cache.js +15 -25
  11. package/lib/constants.js +7 -0
  12. package/lib/markdownlint.d.ts +27 -19
  13. package/lib/markdownlint.js +438 -344
  14. package/lib/md004.js +4 -4
  15. package/lib/md005.js +4 -4
  16. package/lib/md006.js +4 -4
  17. package/lib/md007.js +8 -6
  18. package/lib/md009.js +20 -13
  19. package/lib/md010.js +34 -16
  20. package/lib/md011.js +4 -4
  21. package/lib/md013.js +4 -5
  22. package/lib/md014.js +4 -4
  23. package/lib/md021.js +3 -1
  24. package/lib/md026.js +1 -1
  25. package/lib/md027.js +2 -2
  26. package/lib/md028.js +2 -2
  27. package/lib/md029.js +5 -4
  28. package/lib/md030.js +4 -4
  29. package/lib/md031.js +2 -2
  30. package/lib/md032.js +3 -2
  31. package/lib/md033.js +12 -9
  32. package/lib/md034.js +2 -2
  33. package/lib/md035.js +10 -5
  34. package/lib/md036.js +2 -2
  35. package/lib/md037.js +5 -3
  36. package/lib/md038.js +7 -4
  37. package/lib/md039.js +8 -5
  38. package/lib/md042.js +17 -10
  39. package/lib/md043.js +2 -3
  40. package/lib/md044.js +21 -10
  41. package/lib/md046.js +14 -13
  42. package/lib/md048.js +13 -14
  43. package/lib/md049-md050.js +73 -0
  44. package/lib/md051.js +84 -0
  45. package/lib/md052.js +35 -0
  46. package/lib/md053.js +52 -0
  47. package/lib/rules.js +8 -6
  48. package/package.json +37 -32
  49. package/schema/.markdownlint.jsonc +30 -3
  50. package/schema/.markdownlint.yaml +26 -1
  51. package/schema/markdownlint-config-schema.json +159 -683
package/lib/md039.js CHANGED
@@ -4,7 +4,8 @@
4
4
 
5
5
  const { addErrorContext, filterTokens } = require("../helpers");
6
6
 
7
- const spaceInLinkRe = /\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=\(\S*\))/;
7
+ const spaceInLinkRe =
8
+ /\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=((?:\([^)]*\))|(?:\[[^\]]*\])))/;
8
9
 
9
10
  module.exports = {
10
11
  "names": [ "MD039", "no-space-in-links" ],
@@ -17,8 +18,8 @@ module.exports = {
17
18
  let inLink = false;
18
19
  let linkText = "";
19
20
  let lineIndex = 0;
20
- children.forEach((child) => {
21
- const { content, type } = child;
21
+ for (const child of children) {
22
+ const { content, markup, type } = child;
22
23
  if (type === "link_open") {
23
24
  inLink = true;
24
25
  linkText = "";
@@ -56,9 +57,11 @@ module.exports = {
56
57
  lineNumber++;
57
58
  lineIndex = 0;
58
59
  } else if (inLink) {
59
- linkText += content;
60
+ linkText += type.endsWith("_inline") ?
61
+ `${markup}${content}${markup}` :
62
+ (content || markup);
60
63
  }
61
- });
64
+ }
62
65
  });
63
66
  }
64
67
  };
package/lib/md042.js CHANGED
@@ -2,11 +2,9 @@
2
2
 
3
3
  "use strict";
4
4
 
5
- const { addErrorContext, filterTokens, rangeFromRegExp } =
5
+ const { addErrorContext, escapeForRegExp, filterTokens } =
6
6
  require("../helpers");
7
7
 
8
- const emptyLinkRe = /\[[^\]]*](?:\((?:#?|(?:<>))\))/;
9
-
10
8
  module.exports = {
11
9
  "names": [ "MD042", "no-empty-links" ],
12
10
  "description": "No empty links",
@@ -16,27 +14,36 @@ module.exports = {
16
14
  let inLink = false;
17
15
  let linkText = "";
18
16
  let emptyLink = false;
19
- token.children.forEach(function forChild(child) {
17
+ for (const child of token.children) {
20
18
  if (child.type === "link_open") {
21
19
  inLink = true;
22
20
  linkText = "";
23
- child.attrs.forEach(function forAttr(attr) {
21
+ for (const attr of child.attrs) {
24
22
  if (attr[0] === "href" && (!attr[1] || (attr[1] === "#"))) {
25
23
  emptyLink = true;
26
24
  }
27
- });
25
+ }
28
26
  } else if (child.type === "link_close") {
29
27
  inLink = false;
30
28
  if (emptyLink) {
31
- addErrorContext(onError, child.lineNumber,
32
- "[" + linkText + "]()", null, null,
33
- rangeFromRegExp(child.line, emptyLinkRe));
29
+ let context = `[${linkText}]`;
30
+ let range = null;
31
+ const match = child.line.match(
32
+ new RegExp(`${escapeForRegExp(context)}\\((?:|#|<>)\\)`)
33
+ );
34
+ if (match) {
35
+ context = match[0];
36
+ range = [ match.index + 1, match[0].length ];
37
+ }
38
+ addErrorContext(
39
+ onError, child.lineNumber, context, null, null, range
40
+ );
34
41
  emptyLink = false;
35
42
  }
36
43
  } else if (inLink) {
37
44
  linkText += child.content;
38
45
  }
39
- });
46
+ }
40
47
  });
41
48
  }
42
49
  };
package/lib/md043.js CHANGED
@@ -13,14 +13,13 @@ module.exports = {
13
13
  const requiredHeadings = params.config.headings || params.config.headers;
14
14
  if (Array.isArray(requiredHeadings)) {
15
15
  const levels = {};
16
- [ 1, 2, 3, 4, 5, 6 ].forEach((level) => {
16
+ for (const level of [ 1, 2, 3, 4, 5, 6 ]) {
17
17
  levels["h" + level] = "######".substr(-level);
18
- });
18
+ }
19
19
  let i = 0;
20
20
  let matchAny = false;
21
21
  let hasError = false;
22
22
  let anyHeadings = false;
23
- // eslint-disable-next-line func-style
24
23
  const getExpected = () => requiredHeadings[i++] || "[None]";
25
24
  forEachHeading(params, (heading, content) => {
26
25
  if (!hasError) {
package/lib/md044.js CHANGED
@@ -3,8 +3,10 @@
3
3
  "use strict";
4
4
 
5
5
  const { addErrorDetailIf, bareUrlRe, escapeForRegExp, forEachLine,
6
- overlapsAnyRange, linkRe, linkReferenceRe } = require("../helpers");
7
- const { inlineCodeSpanRanges, lineMetadata } = require("./cache");
6
+ forEachLink, withinAnyRange, linkReferenceDefinitionRe } =
7
+ require("../helpers");
8
+ const { codeBlockAndSpanRanges, htmlElementRanges, lineMetadata } =
9
+ require("./cache");
8
10
 
9
11
  module.exports = {
10
12
  "names": [ "MD044", "proper-names" ],
@@ -15,28 +17,34 @@ module.exports = {
15
17
  names = Array.isArray(names) ? names : [];
16
18
  names.sort((a, b) => (b.length - a.length) || a.localeCompare(b));
17
19
  const codeBlocks = params.config.code_blocks;
18
- const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
20
+ const includeCodeBlocks =
21
+ (codeBlocks === undefined) ? true : !!codeBlocks;
22
+ const htmlElements = params.config.html_elements;
23
+ const includeHtmlElements =
24
+ (htmlElements === undefined) ? true : !!htmlElements;
19
25
  const exclusions = [];
20
26
  forEachLine(lineMetadata(), (line, lineIndex) => {
21
- if (linkReferenceRe.test(line)) {
27
+ if (linkReferenceDefinitionRe.test(line)) {
22
28
  exclusions.push([ lineIndex, 0, line.length ]);
23
29
  } else {
24
30
  let match = null;
25
31
  while ((match = bareUrlRe.exec(line)) !== null) {
26
32
  exclusions.push([ lineIndex, match.index, match[0].length ]);
27
33
  }
28
- while ((match = linkRe.exec(line)) !== null) {
29
- const [ , text, destination ] = match;
34
+ forEachLink(line, (index, _, text, destination) => {
30
35
  if (destination) {
31
36
  exclusions.push(
32
- [ lineIndex, match.index + text.length, destination.length ]
37
+ [ lineIndex, index + text.length, destination.length ]
33
38
  );
34
39
  }
35
- }
40
+ });
36
41
  }
37
42
  });
38
43
  if (!includeCodeBlocks) {
39
- exclusions.push(...inlineCodeSpanRanges());
44
+ exclusions.push(...codeBlockAndSpanRanges());
45
+ }
46
+ if (!includeHtmlElements) {
47
+ exclusions.push(...htmlElementRanges());
40
48
  }
41
49
  for (const name of names) {
42
50
  const escapedName = escapeForRegExp(name);
@@ -52,7 +60,10 @@ module.exports = {
52
60
  const [ , leftMatch, nameMatch ] = match;
53
61
  const index = match.index + leftMatch.length;
54
62
  const length = nameMatch.length;
55
- if (!overlapsAnyRange(exclusions, lineIndex, index, length)) {
63
+ if (
64
+ !withinAnyRange(exclusions, lineIndex, index, length) &&
65
+ !names.includes(nameMatch)
66
+ ) {
56
67
  addErrorDetailIf(
57
68
  onError,
58
69
  lineIndex + 1,
package/lib/md046.js CHANGED
@@ -15,18 +15,19 @@ module.exports = {
15
15
  "tags": [ "code" ],
16
16
  "function": function MD046(params, onError) {
17
17
  let expectedStyle = String(params.config.style || "consistent");
18
- params.tokens
19
- .filter((token) => token.type === "code_block" || token.type === "fence")
20
- .forEach((token) => {
21
- const { lineNumber, type } = token;
22
- if (expectedStyle === "consistent") {
23
- expectedStyle = tokenTypeToStyle[type];
24
- }
25
- addErrorDetailIf(
26
- onError,
27
- lineNumber,
28
- expectedStyle,
29
- tokenTypeToStyle[type]);
30
- });
18
+ const codeBlocksAndFences = params.tokens.filter(
19
+ (token) => (token.type === "code_block") || (token.type === "fence")
20
+ );
21
+ for (const token of codeBlocksAndFences) {
22
+ const { lineNumber, type } = token;
23
+ if (expectedStyle === "consistent") {
24
+ expectedStyle = tokenTypeToStyle[type];
25
+ }
26
+ addErrorDetailIf(
27
+ onError,
28
+ lineNumber,
29
+ expectedStyle,
30
+ tokenTypeToStyle[type]);
31
+ }
31
32
  }
32
33
  };
package/lib/md048.js CHANGED
@@ -11,19 +11,18 @@ module.exports = {
11
11
  "function": function MD048(params, onError) {
12
12
  const style = String(params.config.style || "consistent");
13
13
  let expectedStyle = style;
14
- params.tokens
15
- .filter((token) => token.type === "fence")
16
- .forEach((fenceToken) => {
17
- const { lineNumber, markup } = fenceToken;
18
- if (expectedStyle === "consistent") {
19
- expectedStyle = fencedCodeBlockStyleFor(markup);
20
- }
21
- addErrorDetailIf(
22
- onError,
23
- lineNumber,
24
- expectedStyle,
25
- fencedCodeBlockStyleFor(markup)
26
- );
27
- });
14
+ const fenceTokens = params.tokens.filter((token) => token.type === "fence");
15
+ for (const fenceToken of fenceTokens) {
16
+ const { lineNumber, markup } = fenceToken;
17
+ if (expectedStyle === "consistent") {
18
+ expectedStyle = fencedCodeBlockStyleFor(markup);
19
+ }
20
+ addErrorDetailIf(
21
+ onError,
22
+ lineNumber,
23
+ expectedStyle,
24
+ fencedCodeBlockStyleFor(markup)
25
+ );
26
+ }
28
27
  }
29
28
  };
@@ -0,0 +1,73 @@
1
+ // @ts-check
2
+
3
+ "use strict";
4
+
5
+ const { addError, emphasisOrStrongStyleFor, forEachInlineChild,
6
+ getNextChildToken, getRangeAndFixInfoIfFound } = require("../helpers");
7
+
8
+ const impl = (params, onError, tagPrefix, asterisk, underline, style) => {
9
+ let lastLineNumber = -1;
10
+ const instances = new Map();
11
+ forEachInlineChild(params, `${tagPrefix}_open`, (token, parent) => {
12
+ const { lineNumber, markup } = token;
13
+ const markupStyle = emphasisOrStrongStyleFor(markup);
14
+ if (style === "consistent") {
15
+ style = markupStyle;
16
+ }
17
+ if (style !== markupStyle) {
18
+ let rangeAndFixInfo = {};
19
+ const contentToken = getNextChildToken(
20
+ parent, token, "text", `${tagPrefix}_close`
21
+ );
22
+ if (contentToken) {
23
+ const { content } = contentToken;
24
+ const actual = `${markup}${content}${markup}`;
25
+ const expectedMarkup =
26
+ (style === "asterisk") ? asterisk : underline;
27
+ const expected = `${expectedMarkup}${content}${expectedMarkup}`;
28
+ if (lastLineNumber !== lineNumber) {
29
+ lastLineNumber = lineNumber;
30
+ instances.clear();
31
+ }
32
+ const instance = (instances.get(expected) || 0) + 1;
33
+ instances.set(expected, instance);
34
+ rangeAndFixInfo = getRangeAndFixInfoIfFound(
35
+ params.lines,
36
+ lineNumber - 1,
37
+ actual,
38
+ expected,
39
+ instance
40
+ );
41
+ }
42
+ addError(
43
+ onError,
44
+ lineNumber,
45
+ `Expected: ${style}; Actual: ${markupStyle}`,
46
+ null,
47
+ rangeAndFixInfo.range,
48
+ rangeAndFixInfo.fixInfo
49
+ );
50
+ }
51
+ });
52
+ };
53
+
54
+ module.exports = [
55
+ {
56
+ "names": [ "MD049", "emphasis-style" ],
57
+ "description": "Emphasis style should be consistent",
58
+ "tags": [ "emphasis" ],
59
+ "function": function MD049(params, onError) {
60
+ const style = String(params.config.style || "consistent");
61
+ return impl(params, onError, "em", "*", "_", style);
62
+ }
63
+ },
64
+ {
65
+ "names": [ "MD050", "strong-style" ],
66
+ "description": "Strong style should be consistent",
67
+ "tags": [ "emphasis" ],
68
+ "function": function MD050(params, onError) {
69
+ const style = String(params.config.style || "consistent");
70
+ return impl(params, onError, "strong", "**", "__", style);
71
+ }
72
+ }
73
+ ];
package/lib/md051.js ADDED
@@ -0,0 +1,84 @@
1
+ // @ts-check
2
+
3
+ "use strict";
4
+
5
+ const { addError, escapeForRegExp, filterTokens, forEachInlineChild,
6
+ forEachHeading, htmlElementRe } = require("../helpers");
7
+
8
+ // Regular expression for identifying HTML anchor names
9
+ const identifierRe = /(?:id|name)\s*=\s*['"]?([^'"\s>]+)/iu;
10
+
11
+ /**
12
+ * Converts a Markdown heading into an HTML fragment according to the rules
13
+ * used by GitHub.
14
+ *
15
+ * @param {Object} inline Inline token for heading.
16
+ * @returns {string} Fragment string for heading.
17
+ */
18
+ function convertHeadingToHTMLFragment(inline) {
19
+ const inlineText = inline.children.map((token) => token.content).join("");
20
+ return "#" + encodeURIComponent(
21
+ inlineText
22
+ .toLowerCase()
23
+ // RegExp source with Ruby's \p{Word} expanded into its General Categories
24
+ // eslint-disable-next-line max-len
25
+ // https://github.com/gjtorikian/html-pipeline/blob/main/lib/html/pipeline/toc_filter.rb
26
+ // https://ruby-doc.org/core-3.0.2/Regexp.html
27
+ .replace(
28
+ /[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,
29
+ ""
30
+ )
31
+ .replace(/ /gu, "-")
32
+ );
33
+ }
34
+
35
+ module.exports = {
36
+ "names": [ "MD051", "link-fragments" ],
37
+ "description": "Link fragments should be valid",
38
+ "tags": [ "links" ],
39
+ "function": function MD051(params, onError) {
40
+ const fragments = new Map();
41
+ // Process headings
42
+ forEachHeading(params, (heading, content, inline) => {
43
+ const fragment = convertHeadingToHTMLFragment(inline);
44
+ const count = fragments.get(fragment) || 0;
45
+ if (count) {
46
+ fragments.set(`${fragment}-${count}`, 0);
47
+ }
48
+ fragments.set(fragment, count + 1);
49
+ });
50
+ // Process HTML anchors
51
+ const processHtmlToken = (token) => {
52
+ let match = null;
53
+ while ((match = htmlElementRe.exec(token.content)) !== null) {
54
+ const [ tag, , element ] = match;
55
+ if (element.toLowerCase() === "a") {
56
+ const idMatch = identifierRe.exec(tag);
57
+ if (idMatch) {
58
+ fragments.set(`#${idMatch[1]}`, 0);
59
+ }
60
+ }
61
+ }
62
+ };
63
+ filterTokens(params, "html_block", processHtmlToken);
64
+ forEachInlineChild(params, "html_inline", processHtmlToken);
65
+ // Process link fragments
66
+ forEachInlineChild(params, "link_open", (token) => {
67
+ const { attrs, lineNumber, line } = token;
68
+ const href = attrs.find((attr) => attr[0] === "href");
69
+ const id = href && href[1];
70
+ if (id && (id.length > 1) && (id[0] === "#") && !fragments.has(id)) {
71
+ let context = id;
72
+ let range = null;
73
+ const match = line.match(
74
+ new RegExp(`\\[.*?\\]\\(${escapeForRegExp(context)}\\)`)
75
+ );
76
+ if (match) {
77
+ context = match[0];
78
+ range = [ match.index + 1, match[0].length ];
79
+ }
80
+ addError(onError, lineNumber, null, context, range);
81
+ }
82
+ });
83
+ }
84
+ };
package/lib/md052.js ADDED
@@ -0,0 +1,35 @@
1
+ // @ts-check
2
+
3
+ "use strict";
4
+
5
+ const { addError } = require("../helpers");
6
+ const { referenceLinkImageData } = require("./cache");
7
+
8
+ module.exports = {
9
+ "names": [ "MD052", "reference-links-images" ],
10
+ "description":
11
+ "Reference links and images should use a label that is defined",
12
+ "tags": [ "images", "links" ],
13
+ "function": function MD052(params, onError) {
14
+ const { lines } = params;
15
+ const { references, definitions } = referenceLinkImageData();
16
+ // Look for links/images that use an undefined link reference
17
+ for (const reference of references.entries()) {
18
+ const [ label, datas ] = reference;
19
+ if (!definitions.has(label)) {
20
+ for (const data of datas) {
21
+ const [ lineIndex, index, length ] = data;
22
+ // Context will be incomplete if reporting for a multi-line link
23
+ const context = lines[lineIndex].slice(index, index + length);
24
+ addError(
25
+ onError,
26
+ lineIndex + 1,
27
+ `Missing link or image reference definition: "${label}"`,
28
+ context,
29
+ [ index + 1, context.length ]
30
+ );
31
+ }
32
+ }
33
+ }
34
+ }
35
+ };
package/lib/md053.js ADDED
@@ -0,0 +1,52 @@
1
+ // @ts-check
2
+
3
+ "use strict";
4
+
5
+ const { addError, ellipsify, linkReferenceDefinitionRe } =
6
+ require("../helpers");
7
+ const { referenceLinkImageData } = require("./cache");
8
+
9
+ module.exports = {
10
+ "names": [ "MD053", "link-image-reference-definitions" ],
11
+ "description": "Link and image reference definitions should be needed",
12
+ "tags": [ "images", "links" ],
13
+ "function": function MD053(params, onError) {
14
+ const { lines } = params;
15
+ const { references, shortcuts, definitions, duplicateDefinitions } =
16
+ referenceLinkImageData();
17
+ const singleLineDefinition = (line) => (
18
+ line.replace(linkReferenceDefinitionRe, "").trim().length > 0
19
+ );
20
+ const deleteFixInfo = {
21
+ "deleteCount": -1
22
+ };
23
+ // Look for unused link references (unreferenced by any link/image)
24
+ for (const definition of definitions.entries()) {
25
+ const [ label, lineIndex ] = definition;
26
+ if (!references.has(label) && !shortcuts.has(label)) {
27
+ const line = lines[lineIndex];
28
+ addError(
29
+ onError,
30
+ lineIndex + 1,
31
+ `Unused link or image reference definition: "${label}"`,
32
+ ellipsify(line),
33
+ [ 1, line.length ],
34
+ singleLineDefinition(line) ? deleteFixInfo : 0
35
+ );
36
+ }
37
+ }
38
+ // Look for duplicate link references (defined more than once)
39
+ for (const duplicateDefinition of duplicateDefinitions) {
40
+ const [ label, lineIndex ] = duplicateDefinition;
41
+ const line = lines[lineIndex];
42
+ addError(
43
+ onError,
44
+ lineIndex + 1,
45
+ `Duplicate link or image reference definition: "${label}"`,
46
+ ellipsify(line),
47
+ [ 1, line.length ],
48
+ singleLineDefinition(line) ? deleteFixInfo : 0
49
+ );
50
+ }
51
+ }
52
+ };
package/lib/rules.js CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  "use strict";
4
4
 
5
- const packageJson = require("../package.json");
6
- const homepage = packageJson.homepage;
7
- const version = packageJson.version;
5
+ const { homepage, version } = require("./constants");
8
6
 
9
7
  const rules = [
10
8
  require("./md001"),
@@ -50,12 +48,16 @@ const rules = [
50
48
  require("./md045"),
51
49
  require("./md046"),
52
50
  require("./md047"),
53
- require("./md048")
51
+ require("./md048"),
52
+ ...require("./md049-md050"),
53
+ require("./md051"),
54
+ require("./md052"),
55
+ require("./md053")
54
56
  ];
55
- rules.forEach((rule) => {
57
+ for (const rule of rules) {
56
58
  const name = rule.names[0].toLowerCase();
57
59
  // eslint-disable-next-line dot-notation
58
60
  rule["information"] =
59
61
  new URL(`${homepage}/blob/v${version}/doc/Rules.md#${name}`);
60
- });
62
+ }
61
63
  module.exports = rules;
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "markdownlint",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "A Node.js style checker and lint tool for Markdown/CommonMark files.",
5
+ "type": "commonjs",
5
6
  "main": "lib/markdownlint.js",
6
7
  "types": "lib/markdownlint.d.ts",
7
8
  "author": "David Anson (https://dlaa.me/)",
@@ -16,11 +17,10 @@
16
17
  "build-config": "npm run build-config-schema && npm run build-config-example",
17
18
  "build-config-example": "node schema/build-config-example.js",
18
19
  "build-config-schema": "node schema/build-config-schema.js",
19
- "build-declaration": "tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'",
20
- "build-demo": "cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && webpack --no-stats",
20
+ "build-declaration": "tsc --allowJs --declaration --emitDeclarationOnly --module commonjs --resolveJsonModule --target es2015 lib/markdownlint.js && node scripts delete 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'",
21
+ "build-demo": "node scripts copy node_modules/markdown-it/dist/markdown-it.min.js demo/markdown-it.min.js && cd demo && webpack --no-stats",
21
22
  "build-example": "npm install --no-save --ignore-scripts grunt grunt-cli gulp through2",
22
- "ci": "npm-run-all --continue-on-error --parallel test-cover lint declaration build-config build-demo && git diff --exit-code",
23
- "clean-test-repos": "rimraf test-repos",
23
+ "ci": "npm-run-all --continue-on-error --parallel build-config lint serial-declaration-demo test-cover && git diff --exit-code",
24
24
  "clone-test-repos-dotnet-docs": "cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet",
25
25
  "clone-test-repos-eslint-eslint": "cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet",
26
26
  "clone-test-repos-mkdocs-mkdocs": "cd test-repos && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet",
@@ -33,43 +33,48 @@
33
33
  "clone-test-repos-large": "npm run clone-test-repos && cd test-repos && npm run clone-test-repos-dotnet-docs && npm run clone-test-repos-v8-v8-dev",
34
34
  "declaration": "npm run build-declaration && npm run test-declaration",
35
35
  "example": "cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint",
36
+ "docker-npm-install": "docker run --rm --tty --name npm-install --volume $PWD:/home/workdir --workdir /home/workdir --user node node:16 npm install",
37
+ "docker-npm-run-upgrade": "docker run --rm --tty --name npm-run-upgrade --volume $PWD:/home/workdir --workdir /home/workdir --user node node:16 npm run upgrade",
36
38
  "lint": "eslint --max-warnings 0 .",
37
39
  "lint-test-repos": "ava --timeout=5m test/markdownlint-test-repos.js",
38
- "test": "ava test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js",
40
+ "serial-declaration-demo": "npm run build-declaration && npm-run-all --continue-on-error --parallel build-demo test-declaration",
41
+ "test": "ava test/markdownlint-test.js test/markdownlint-test-config.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js",
39
42
  "test-cover": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test",
40
43
  "test-declaration": "cd example/typescript && tsc && node type-check.js",
41
- "test-extra": "ava --timeout=5m test/markdownlint-test-extra.js"
44
+ "test-extra": "ava --timeout=5m test/markdownlint-test-extra-parse.js test/markdownlint-test-extra-type.js",
45
+ "update-snapshots": "ava --update-snapshots test/markdownlint-test-scenarios.js",
46
+ "upgrade": "npx --yes npm-check-updates --upgrade"
42
47
  },
43
48
  "engines": {
44
- "node": ">=10"
49
+ "node": ">=14"
45
50
  },
46
51
  "dependencies": {
47
- "markdown-it": "12.2.0"
52
+ "markdown-it": "13.0.1"
48
53
  },
49
54
  "devDependencies": {
50
- "ava": "~3.15.0",
51
- "c8": "~7.8.0",
52
- "cpy-cli": "~3.1.1",
53
- "eslint": "~7.32.0",
54
- "eslint-plugin-jsdoc": "~36.0.7",
55
- "eslint-plugin-node": "~11.1.0",
56
- "eslint-plugin-unicorn": "~35.0.0",
57
- "globby": "~11.0.4",
58
- "js-yaml": "~4.1.0",
59
- "markdown-it-for-inline": "~0.1.1",
60
- "markdown-it-sub": "~1.0.0",
61
- "markdown-it-sup": "~1.0.0",
62
- "markdown-it-texmath": "~0.9.1",
63
- "markdownlint-rule-helpers": "~0.14.0",
64
- "npm-run-all": "~4.1.5",
65
- "rimraf": "~3.0.2",
66
- "strip-json-comments": "~3.1.1",
67
- "toml": "~3.0.0",
68
- "ts-loader": "~9.2.5",
69
- "tv4": "~1.3.0",
70
- "typescript": "~4.3.5",
71
- "webpack": "~5.51.1",
72
- "webpack-cli": "~4.8.0"
55
+ "ava": "4.3.0",
56
+ "c8": "7.11.3",
57
+ "eslint": "8.18.0",
58
+ "eslint-plugin-es": "4.1.0",
59
+ "eslint-plugin-jsdoc": "39.3.3",
60
+ "eslint-plugin-node": "11.1.0",
61
+ "eslint-plugin-unicorn": "42.0.0",
62
+ "globby": "13.1.2",
63
+ "js-yaml": "4.1.0",
64
+ "markdown-it-for-inline": "0.1.1",
65
+ "markdown-it-sub": "1.0.0",
66
+ "markdown-it-sup": "1.0.0",
67
+ "markdown-it-texmath": "1.0.0",
68
+ "markdownlint-rule-github-internal-links": "0.1.0",
69
+ "markdownlint-rule-helpers": "0.16.0",
70
+ "npm-run-all": "4.1.5",
71
+ "strip-json-comments": "4.0.0",
72
+ "toml": "3.0.0",
73
+ "ts-loader": "9.3.0",
74
+ "tv4": "1.3.0",
75
+ "typescript": "4.7.4",
76
+ "webpack": "5.73.0",
77
+ "webpack-cli": "4.10.0"
73
78
  },
74
79
  "keywords": [
75
80
  "markdown",