markdownlint-rule-numbered-headings-unique 1.0.5 → 1.0.7

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.
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  /** @type import("markdownlint").Rule */
4
- module.exports = {
5
- "names": ["numbered-headings-unique"],
6
- "description": "Headings ending in a number must be unique in the document",
7
- "tags": ["headings", "headers", "numbers", "unique"],
4
+ const rule = {
5
+ names: ["numbered-headings-unique"],
6
+ description: "Headings ending in a number must be unique in the document",
7
+ tags: ["headings", "headers", "numbers", "unique"],
8
8
  function(params, onError) {
9
-
10
9
  // Track seen heading numbers: text -> [lineNumbers]
11
10
  const seenNumbers = new Map();
12
11
  params.tokens.forEach((token, idx) => {
@@ -26,7 +25,6 @@ module.exports = {
26
25
  }
27
26
  }
28
27
  });
29
-
30
28
  // Report all duplicates (all but the first occurrence)
31
29
  for (const [text, lines] of seenNumbers.entries()) {
32
30
  if (lines.length > 1) {
@@ -40,3 +38,5 @@ module.exports = {
40
38
  }
41
39
  }
42
40
  };
41
+
42
+ module.exports = [rule];
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "bugs": {
12
12
  "url": "https://github.com/TomasDahlqvist/markdownlint-rule-numbered-headings-unique/issues"
13
13
  },
14
- "exports": "./numbered-headings-unique.cjs",
14
+ "exports": "./index.cjs",
15
15
  "scripts": {
16
16
  "lint": "markdownlint-cli2 *.md && eslint --max-warnings 0",
17
17
  "test": "npm run lint && node --test --experimental-test-coverage"
@@ -20,7 +20,7 @@
20
20
  "package.json",
21
21
  "LICENSE",
22
22
  "README.md",
23
- "numbered-headings-unique.cjs"
23
+ "index.cjs"
24
24
  ],
25
25
  "keywords": [
26
26
  "markdownlint-rule",
@@ -34,8 +34,8 @@
34
34
  "eslint": "^9.39.1",
35
35
  "markdownlint-cli2": "^0.19.1"
36
36
  },
37
- "version": "1.0.5",
38
- "main": "index.js",
37
+ "version": "1.0.7",
38
+ "main": "index.cjs",
39
39
  "directories": {
40
40
  "test": "test"
41
41
  }