markdownlint 0.23.0 → 0.25.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdownlint",
3
- "version": "0.23.0",
3
+ "version": "0.25.1",
4
4
  "description": "A Node.js style checker and lint tool for Markdown/CommonMark files.",
5
5
  "main": "lib/markdownlint.js",
6
6
  "types": "lib/markdownlint.d.ts",
@@ -16,52 +16,62 @@
16
16
  "build-config": "npm run build-config-schema && npm run build-config-example",
17
17
  "build-config-example": "node schema/build-config-example.js",
18
18
  "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",
19
+ "build-declaration": "tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && node scripts delete 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'",
20
+ "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
21
  "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",
24
- "clone-test-repos": "mkdir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet",
25
- "clone-test-repos-large": "npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet",
22
+ "ci": "npm-run-all --continue-on-error --parallel build-config lint serial-declaration-demo test-cover && git diff --exit-code",
23
+ "clone-test-repos-dotnet-docs": "cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet",
24
+ "clone-test-repos-eslint-eslint": "cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet",
25
+ "clone-test-repos-mkdocs-mkdocs": "cd test-repos && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet",
26
+ "clone-test-repos-mochajs-mocha": "cd test-repos && git clone https://github.com/mochajs/mocha mochajs-mocha --depth 1 --no-tags --quiet",
27
+ "clone-test-repos-pi-hole-docs": "cd test-repos && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet",
28
+ "clone-test-repos-v8-v8-dev": "cd test-repos && git clone https://github.com/v8/v8.dev v8-v8-dev --depth 1 --no-tags --quiet",
29
+ "clone-test-repos-webhintio-hint": "cd test-repos && git clone https://github.com/webhintio/hint webhintio-hint --depth 1 --no-tags --quiet",
30
+ "clone-test-repos-webpack-webpack-js-org": "cd test-repos && git clone https://github.com/webpack/webpack.js.org webpack-webpack-js-org --depth 1 --no-tags --quiet",
31
+ "clone-test-repos": "mkdir test-repos && cd test-repos && npm run clone-test-repos-eslint-eslint && npm run clone-test-repos-mkdocs-mkdocs && npm run clone-test-repos-mochajs-mocha && npm run clone-test-repos-pi-hole-docs && npm run clone-test-repos-webhintio-hint && npm run clone-test-repos-webpack-webpack-js-org",
32
+ "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",
26
33
  "declaration": "npm run build-declaration && npm run test-declaration",
27
34
  "example": "cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint",
35
+ "docker-npm-install": "docker run --rm --tty --name npm-install --volume $PWD:/home/workdir --workdir /home/workdir --user node node:16 npm install",
36
+ "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",
28
37
  "lint": "eslint --max-warnings 0 .",
29
38
  "lint-test-repos": "ava --timeout=5m test/markdownlint-test-repos.js",
30
- "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",
39
+ "serial-declaration-demo": "npm run build-declaration && npm-run-all --continue-on-error --parallel build-demo test-declaration",
40
+ "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",
31
41
  "test-cover": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test",
32
42
  "test-declaration": "cd example/typescript && tsc && node type-check.js",
33
- "test-extra": "ava --timeout=5m test/markdownlint-test-extra.js"
43
+ "test-extra": "ava --timeout=5m test/markdownlint-test-extra-parse.js test/markdownlint-test-extra-type.js",
44
+ "upgrade": "npx --yes npm-check-updates --upgrade"
34
45
  },
35
46
  "engines": {
36
- "node": ">=10"
47
+ "node": ">=12"
37
48
  },
38
49
  "dependencies": {
39
- "markdown-it": "12.0.4"
50
+ "markdown-it": "12.3.2"
40
51
  },
41
52
  "devDependencies": {
42
- "ava": "~3.15.0",
43
- "c8": "~7.5.0",
44
- "cpy-cli": "~3.1.1",
45
- "eslint": "~7.19.0",
46
- "eslint-plugin-jsdoc": "~31.6.0",
47
- "eslint-plugin-node": "~11.1.0",
48
- "eslint-plugin-unicorn": "~27.0.0",
49
- "globby": "~11.0.2",
50
- "js-yaml": "~4.0.0",
51
- "markdown-it-for-inline": "~0.1.1",
52
- "markdown-it-sub": "~1.0.0",
53
- "markdown-it-sup": "~1.0.0",
54
- "markdown-it-texmath": "~0.8.0",
55
- "markdownlint-rule-helpers": "~0.13.0",
56
- "npm-run-all": "~4.1.5",
57
- "rimraf": "~3.0.2",
58
- "strip-json-comments": "~3.1.1",
59
- "toml": "~3.0.0",
60
- "ts-loader": "~8.0.15",
61
- "tv4": "~1.3.0",
62
- "typescript": "~4.1.3",
63
- "webpack": "~5.21.1",
64
- "webpack-cli": "~4.5.0"
53
+ "ava": "3.15.0",
54
+ "c8": "7.10.0",
55
+ "eslint": "8.5.0",
56
+ "eslint-plugin-jsdoc": "37.4.0",
57
+ "eslint-plugin-node": "11.1.0",
58
+ "eslint-plugin-unicorn": "39.0.0",
59
+ "globby": "12.0.2",
60
+ "js-yaml": "4.1.0",
61
+ "markdown-it-for-inline": "0.1.1",
62
+ "markdown-it-sub": "1.0.0",
63
+ "markdown-it-sup": "1.0.0",
64
+ "markdown-it-texmath": "0.9.7",
65
+ "markdownlint-rule-github-internal-links": "0.1.0",
66
+ "markdownlint-rule-helpers": "0.15.0",
67
+ "npm-run-all": "4.1.5",
68
+ "strip-json-comments": "4.0.0",
69
+ "toml": "3.0.0",
70
+ "ts-loader": "9.2.6",
71
+ "tv4": "1.3.0",
72
+ "typescript": "4.5.4",
73
+ "webpack": "5.65.0",
74
+ "webpack-cli": "4.9.1"
65
75
  },
66
76
  "keywords": [
67
77
  "markdown",
@@ -39,7 +39,9 @@
39
39
  // Spaces for indent
40
40
  "indent": 2,
41
41
  // Whether to indent the first level of the list
42
- "start_indented": false
42
+ "start_indented": false,
43
+ // Spaces for first level indent (when start_indented is set)
44
+ "start_indent": 2
43
45
  },
44
46
 
45
47
  // MD009/no-trailing-spaces - Trailing spaces
@@ -55,7 +57,9 @@
55
57
  // MD010/no-hard-tabs - Hard tabs
56
58
  "MD010": {
57
59
  // Include code blocks
58
- "code_blocks": true
60
+ "code_blocks": true,
61
+ // Number of spaces for each hard tab
62
+ "spaces_per_tab": 1
59
63
  },
60
64
 
61
65
  // MD011/no-reversed-links - Reversed link syntax
@@ -244,7 +248,19 @@
244
248
 
245
249
  // MD048/code-fence-style - Code fence style
246
250
  "MD048": {
247
- // Code fence syle
251
+ // Code fence style
252
+ "style": "consistent"
253
+ },
254
+
255
+ // MD049/emphasis-style - Emphasis style should be consistent
256
+ "MD049": {
257
+ // Emphasis style should be consistent
258
+ "style": "consistent"
259
+ },
260
+
261
+ // MD050/strong-style - Strong style should be consistent
262
+ "MD050": {
263
+ // Strong style should be consistent
248
264
  "style": "consistent"
249
265
  }
250
266
  }
@@ -36,6 +36,8 @@ MD007:
36
36
  indent: 2
37
37
  # Whether to indent the first level of the list
38
38
  start_indented: false
39
+ # Spaces for first level indent (when start_indented is set)
40
+ start_indent: 2
39
41
 
40
42
  # MD009/no-trailing-spaces - Trailing spaces
41
43
  MD009:
@@ -50,6 +52,8 @@ MD009:
50
52
  MD010:
51
53
  # Include code blocks
52
54
  code_blocks: true
55
+ # Number of spaces for each hard tab
56
+ spaces_per_tab: 1
53
57
 
54
58
  # MD011/no-reversed-links - Reversed link syntax
55
59
  MD011: true
@@ -221,5 +225,15 @@ MD047: true
221
225
 
222
226
  # MD048/code-fence-style - Code fence style
223
227
  MD048:
224
- # Code fence syle
228
+ # Code fence style
229
+ style: "consistent"
230
+
231
+ # MD049/emphasis-style - Emphasis style should be consistent
232
+ MD049:
233
+ # Emphasis style should be consistent
234
+ style: "consistent"
235
+
236
+ # MD050/strong-style - Strong style should be consistent
237
+ MD050:
238
+ # Strong style should be consistent
225
239
  style: "consistent"
@@ -238,6 +238,11 @@
238
238
  "description": "Whether to indent the first level of the list",
239
239
  "type": "boolean",
240
240
  "default": false
241
+ },
242
+ "start_indent": {
243
+ "description": "Spaces for first level indent (when start_indented is set)",
244
+ "type": "integer",
245
+ "default": 2
241
246
  }
242
247
  },
243
248
  "additionalProperties": false
@@ -259,6 +264,11 @@
259
264
  "description": "Whether to indent the first level of the list",
260
265
  "type": "boolean",
261
266
  "default": false
267
+ },
268
+ "start_indent": {
269
+ "description": "Spaces for first level indent (when start_indented is set)",
270
+ "type": "integer",
271
+ "default": 2
262
272
  }
263
273
  },
264
274
  "additionalProperties": false
@@ -327,6 +337,11 @@
327
337
  "description": "Include code blocks",
328
338
  "type": "boolean",
329
339
  "default": true
340
+ },
341
+ "spaces_per_tab": {
342
+ "description": "Number of spaces for each hard tab",
343
+ "type": "number",
344
+ "default": 1
330
345
  }
331
346
  },
332
347
  "additionalProperties": false
@@ -343,6 +358,11 @@
343
358
  "description": "Include code blocks",
344
359
  "type": "boolean",
345
360
  "default": true
361
+ },
362
+ "spaces_per_tab": {
363
+ "description": "Number of spaces for each hard tab",
364
+ "type": "number",
365
+ "default": 1
346
366
  }
347
367
  },
348
368
  "additionalProperties": false
@@ -1396,7 +1416,7 @@
1396
1416
  "default": true,
1397
1417
  "properties": {
1398
1418
  "style": {
1399
- "description": "Code fence syle",
1419
+ "description": "Code fence style",
1400
1420
  "type": "string",
1401
1421
  "enum": [
1402
1422
  "consistent",
@@ -1417,7 +1437,7 @@
1417
1437
  "default": true,
1418
1438
  "properties": {
1419
1439
  "style": {
1420
- "description": "Code fence syle",
1440
+ "description": "Code fence style",
1421
1441
  "type": "string",
1422
1442
  "enum": [
1423
1443
  "consistent",
@@ -1429,6 +1449,90 @@
1429
1449
  },
1430
1450
  "additionalProperties": false
1431
1451
  },
1452
+ "MD049": {
1453
+ "description": "MD049/emphasis-style - Emphasis style should be consistent",
1454
+ "type": [
1455
+ "boolean",
1456
+ "object"
1457
+ ],
1458
+ "default": true,
1459
+ "properties": {
1460
+ "style": {
1461
+ "description": "Emphasis style should be consistent",
1462
+ "type": "string",
1463
+ "enum": [
1464
+ "consistent",
1465
+ "asterisk",
1466
+ "underscore"
1467
+ ],
1468
+ "default": "consistent"
1469
+ }
1470
+ },
1471
+ "additionalProperties": false
1472
+ },
1473
+ "emphasis-style": {
1474
+ "description": "MD049/emphasis-style - Emphasis style should be consistent",
1475
+ "type": [
1476
+ "boolean",
1477
+ "object"
1478
+ ],
1479
+ "default": true,
1480
+ "properties": {
1481
+ "style": {
1482
+ "description": "Emphasis style should be consistent",
1483
+ "type": "string",
1484
+ "enum": [
1485
+ "consistent",
1486
+ "asterisk",
1487
+ "underscore"
1488
+ ],
1489
+ "default": "consistent"
1490
+ }
1491
+ },
1492
+ "additionalProperties": false
1493
+ },
1494
+ "MD050": {
1495
+ "description": "MD050/strong-style - Strong style should be consistent",
1496
+ "type": [
1497
+ "boolean",
1498
+ "object"
1499
+ ],
1500
+ "default": true,
1501
+ "properties": {
1502
+ "style": {
1503
+ "description": "Strong style should be consistent",
1504
+ "type": "string",
1505
+ "enum": [
1506
+ "consistent",
1507
+ "asterisk",
1508
+ "underscore"
1509
+ ],
1510
+ "default": "consistent"
1511
+ }
1512
+ },
1513
+ "additionalProperties": false
1514
+ },
1515
+ "strong-style": {
1516
+ "description": "MD050/strong-style - Strong style should be consistent",
1517
+ "type": [
1518
+ "boolean",
1519
+ "object"
1520
+ ],
1521
+ "default": true,
1522
+ "properties": {
1523
+ "style": {
1524
+ "description": "Strong style should be consistent",
1525
+ "type": "string",
1526
+ "enum": [
1527
+ "consistent",
1528
+ "asterisk",
1529
+ "underscore"
1530
+ ],
1531
+ "default": "consistent"
1532
+ }
1533
+ },
1534
+ "additionalProperties": false
1535
+ },
1432
1536
  "headings": {
1433
1537
  "description": "headings - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
1434
1538
  "type": "boolean",
@@ -1525,7 +1629,7 @@
1525
1629
  "default": true
1526
1630
  },
1527
1631
  "emphasis": {
1528
- "description": "emphasis - MD036, MD037",
1632
+ "description": "emphasis - MD036, MD037, MD049, MD050",
1529
1633
  "type": "boolean",
1530
1634
  "default": true
1531
1635
  },
@@ -1551,7 +1655,7 @@
1551
1655
  }
1552
1656
  },
1553
1657
  "additionalProperties": {
1554
- "type:": [
1658
+ "type": [
1555
1659
  "boolean",
1556
1660
  "object"
1557
1661
  ]
@@ -1,53 +0,0 @@
1
- // @ts-check
2
-
3
- "use strict";
4
-
5
- const fs = require("fs");
6
- const path = require("path");
7
- const configSchema = require("./markdownlint-config-schema.json");
8
-
9
- const configExample = {};
10
- for (const rule in configSchema.properties) {
11
- if (/^(MD\d{3}|default|extends)$/.test(rule)) {
12
- const properties = configSchema.properties[rule];
13
- configExample[rule + "-description"] = properties.description;
14
- configExample[rule] = properties.default;
15
- if (properties.properties) {
16
- const ruleExample = {};
17
- // eslint-disable-next-line guard-for-in
18
- for (const property in properties.properties) {
19
- const ruleProperties = properties.properties[property];
20
- ruleExample[property + "-sub-description"] = ruleProperties.description;
21
- ruleExample[property] = ruleProperties.default;
22
- }
23
- configExample[rule] = ruleExample;
24
- }
25
- }
26
- }
27
-
28
- const configStringJson = JSON.stringify(configExample, null, 2)
29
- // eslint-disable-next-line max-len
30
- .replace(/^\{/, "{\n // Example markdownlint JSON(C) configuration with all properties set to their default value")
31
- .replace(/(\s+)"[^-"]+-description": "(.+)",/g, "\n$1// $2")
32
- .replace(/"[^-"]+-sub-description": "(.+)",/g, "// $1");
33
- fs.writeFileSync(
34
- path.join(__dirname, ".markdownlint.jsonc"),
35
- configStringJson,
36
- "utf8"
37
- );
38
-
39
- const configStringYaml = configStringJson
40
- .replace(/JSON\(C\)/, "YAML")
41
- .replace(/\n {2}/g, "\n")
42
- .replace(/\/\/ /g, "# ")
43
- .replace(/(\s*)"([^"]+)":/g, "$1$2:")
44
- .replace(/: \{/g, ":")
45
- .replace(/\n\}/g, "")
46
- .replace(/,\n/g, "\n")
47
- .replace(/^\{\n/, "")
48
- .replace(/\}$/, "");
49
- fs.writeFileSync(
50
- path.join(__dirname, ".markdownlint.yaml"),
51
- configStringYaml,
52
- "utf8"
53
- );