markdownlint 0.22.0 → 0.25.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.
package/lib/md044.js CHANGED
@@ -2,11 +2,9 @@
2
2
 
3
3
  "use strict";
4
4
 
5
- const { addErrorDetailIf, bareUrlRe, escapeForRegExp, filterTokens,
6
- forEachInlineChild, newLineRe } = require("../helpers");
7
-
8
- const startNonWordRe = /^\W/;
9
- const endNonWordRe = /\W$/;
5
+ const { addErrorDetailIf, bareUrlRe, escapeForRegExp, forEachLine,
6
+ overlapsAnyRange, linkRe, linkReferenceRe } = require("../helpers");
7
+ const { codeBlockAndSpanRanges, lineMetadata } = require("./cache");
10
8
 
11
9
  module.exports = {
12
10
  "names": [ "MD044", "proper-names" ],
@@ -15,80 +13,65 @@ module.exports = {
15
13
  "function": function MD044(params, onError) {
16
14
  let names = params.config.names;
17
15
  names = Array.isArray(names) ? names : [];
16
+ names.sort((a, b) => (b.length - a.length) || a.localeCompare(b));
18
17
  const codeBlocks = params.config.code_blocks;
19
18
  const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
20
- // Text of automatic hyperlinks is implicitly a URL
21
- const autolinkText = new Set();
22
- filterTokens(params, "inline", (token) => {
23
- let inAutoLink = false;
24
- token.children.forEach((child) => {
25
- const { info, type } = child;
26
- if ((type === "link_open") && (info === "auto")) {
27
- inAutoLink = true;
28
- } else if (type === "link_close") {
29
- inAutoLink = false;
30
- } else if ((type === "text") && inAutoLink) {
31
- autolinkText.add(child);
19
+ const exclusions = [];
20
+ forEachLine(lineMetadata(), (line, lineIndex) => {
21
+ if (linkReferenceRe.test(line)) {
22
+ exclusions.push([ lineIndex, 0, line.length ]);
23
+ } else {
24
+ let match = null;
25
+ while ((match = bareUrlRe.exec(line)) !== null) {
26
+ exclusions.push([ lineIndex, match.index, match[0].length ]);
32
27
  }
33
- });
28
+ while ((match = linkRe.exec(line)) !== null) {
29
+ const [ , text, destination ] = match;
30
+ if (destination) {
31
+ exclusions.push(
32
+ [ lineIndex, match.index + text.length, destination.length ]
33
+ );
34
+ }
35
+ }
36
+ }
34
37
  });
35
- // For each proper name...
36
- names.forEach((name) => {
38
+ if (!includeCodeBlocks) {
39
+ exclusions.push(...codeBlockAndSpanRanges());
40
+ }
41
+ for (const name of names) {
37
42
  const escapedName = escapeForRegExp(name);
38
- const startNamePattern = startNonWordRe.test(name) ? "" : "\\S*\\b";
39
- const endNamePattern = endNonWordRe.test(name) ? "" : "\\b\\S*";
43
+ const startNamePattern = /^\W/.test(name) ? "" : "\\b_*";
44
+ const endNamePattern = /\W$/.test(name) ? "" : "_*\\b";
40
45
  const namePattern =
41
- `(${startNamePattern})(${escapedName})(${endNamePattern})`;
42
- const anyNameRe = new RegExp(namePattern, "gi");
43
- // eslint-disable-next-line jsdoc/require-jsdoc
44
- function forToken(token) {
45
- if (!autolinkText.has(token)) {
46
- const fenceOffset = (token.type === "fence") ? 1 : 0;
47
- token.content.split(newLineRe).forEach((line, index) => {
48
- let match = null;
49
- while ((match = anyNameRe.exec(line)) !== null) {
50
- const [ fullMatch, leftMatch, nameMatch, rightMatch ] = match;
51
- if (fullMatch.search(bareUrlRe) === -1) {
52
- const wordMatch = fullMatch
53
- .replace(new RegExp(`^\\W{0,${leftMatch.length}}`), "")
54
- .replace(new RegExp(`\\W{0,${rightMatch.length}}$`), "");
55
- if (!names.includes(wordMatch)) {
56
- const lineNumber = token.lineNumber + index + fenceOffset;
57
- const fullLine = params.lines[lineNumber - 1];
58
- const matchLength = wordMatch.length;
59
- const matchIndex = fullLine.indexOf(wordMatch);
60
- const range = (matchIndex === -1) ?
61
- null :
62
- [ matchIndex + 1, matchLength ];
63
- const fixInfo = (matchIndex === -1) ?
64
- null :
65
- {
66
- "editColumn": matchIndex + 1,
67
- "deleteCount": matchLength,
68
- "insertText": name
69
- };
70
- addErrorDetailIf(
71
- onError,
72
- lineNumber,
73
- name,
74
- nameMatch,
75
- null,
76
- null,
77
- range,
78
- fixInfo
79
- );
46
+ `(${startNamePattern})(${escapedName})${endNamePattern}`;
47
+ const nameRe = new RegExp(namePattern, "gi");
48
+ forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => {
49
+ if (includeCodeBlocks || (!inCode && !onFence)) {
50
+ let match = null;
51
+ while ((match = nameRe.exec(line)) !== null) {
52
+ const [ , leftMatch, nameMatch ] = match;
53
+ const index = match.index + leftMatch.length;
54
+ const length = nameMatch.length;
55
+ if (!overlapsAnyRange(exclusions, lineIndex, index, length)) {
56
+ addErrorDetailIf(
57
+ onError,
58
+ lineIndex + 1,
59
+ name,
60
+ nameMatch,
61
+ null,
62
+ null,
63
+ [ index + 1, length ],
64
+ {
65
+ "editColumn": index + 1,
66
+ "deleteCount": length,
67
+ "insertText": name
80
68
  }
81
- }
69
+ );
82
70
  }
83
- });
71
+ exclusions.push([ lineIndex, index, length ]);
72
+ }
84
73
  }
85
- }
86
- forEachInlineChild(params, "text", forToken);
87
- if (includeCodeBlocks) {
88
- forEachInlineChild(params, "code_inline", forToken);
89
- filterTokens(params, "code_block", forToken);
90
- filterTokens(params, "fence", forToken);
91
- }
92
- });
74
+ });
75
+ }
93
76
  }
94
77
  };
package/lib/md049.js ADDED
@@ -0,0 +1,45 @@
1
+ // @ts-check
2
+
3
+ "use strict";
4
+
5
+ const { addError, emphasisOrStrongStyleFor, forEachInlineChild,
6
+ getNextChildToken, getRangeAndFixInfoIfFound } = require("../helpers");
7
+
8
+ module.exports = {
9
+ "names": [ "MD049", "emphasis-style" ],
10
+ "description": "Emphasis style should be consistent",
11
+ "tags": [ "emphasis" ],
12
+ "function": function MD049(params, onError) {
13
+ let expectedStyle = String(params.config.style || "consistent");
14
+ forEachInlineChild(params, "em_open", (token, parent) => {
15
+ const { lineNumber, markup } = token;
16
+ const markupStyle = emphasisOrStrongStyleFor(markup);
17
+ if (expectedStyle === "consistent") {
18
+ expectedStyle = markupStyle;
19
+ }
20
+ if (expectedStyle !== markupStyle) {
21
+ let rangeAndFixInfo = {};
22
+ const contentToken = getNextChildToken(
23
+ parent, token, "text", "em_close"
24
+ );
25
+ if (contentToken) {
26
+ const { content } = contentToken;
27
+ const actual = `${markup}${content}${markup}`;
28
+ const expectedMarkup = (expectedStyle === "asterisk") ? "*" : "_";
29
+ const expected = `${expectedMarkup}${content}${expectedMarkup}`;
30
+ rangeAndFixInfo = getRangeAndFixInfoIfFound(
31
+ params.lines, lineNumber - 1, actual, expected
32
+ );
33
+ }
34
+ addError(
35
+ onError,
36
+ lineNumber,
37
+ `Expected: ${expectedStyle}; Actual: ${markupStyle}`,
38
+ null,
39
+ rangeAndFixInfo.range,
40
+ rangeAndFixInfo.fixInfo
41
+ );
42
+ }
43
+ });
44
+ }
45
+ };
package/lib/md050.js ADDED
@@ -0,0 +1,45 @@
1
+ // @ts-check
2
+
3
+ "use strict";
4
+
5
+ const { addError, emphasisOrStrongStyleFor, forEachInlineChild,
6
+ getNextChildToken, getRangeAndFixInfoIfFound } = require("../helpers");
7
+
8
+ module.exports = {
9
+ "names": [ "MD050", "strong-style" ],
10
+ "description": "Strong style should be consistent",
11
+ "tags": [ "emphasis" ],
12
+ "function": function MD050(params, onError) {
13
+ let expectedStyle = String(params.config.style || "consistent");
14
+ forEachInlineChild(params, "strong_open", (token, parent) => {
15
+ const { lineNumber, markup } = token;
16
+ const markupStyle = emphasisOrStrongStyleFor(markup);
17
+ if (expectedStyle === "consistent") {
18
+ expectedStyle = markupStyle;
19
+ }
20
+ if (expectedStyle !== markupStyle) {
21
+ let rangeAndFixInfo = {};
22
+ const contentToken = getNextChildToken(
23
+ parent, token, "text", "strong_close"
24
+ );
25
+ if (contentToken) {
26
+ const { content } = contentToken;
27
+ const actual = `${markup}${content}${markup}`;
28
+ const expectedMarkup = (expectedStyle === "asterisk") ? "**" : "__";
29
+ const expected = `${expectedMarkup}${content}${expectedMarkup}`;
30
+ rangeAndFixInfo = getRangeAndFixInfoIfFound(
31
+ params.lines, lineNumber - 1, actual, expected
32
+ );
33
+ }
34
+ addError(
35
+ onError,
36
+ lineNumber,
37
+ `Expected: ${expectedStyle}; Actual: ${markupStyle}`,
38
+ null,
39
+ rangeAndFixInfo.range,
40
+ rangeAndFixInfo.fixInfo
41
+ );
42
+ }
43
+ });
44
+ }
45
+ };
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,11 +48,14 @@ const rules = [
50
48
  require("./md045"),
51
49
  require("./md046"),
52
50
  require("./md047"),
53
- require("./md048")
51
+ require("./md048"),
52
+ require("./md049"),
53
+ require("./md050")
54
54
  ];
55
55
  rules.forEach((rule) => {
56
56
  const name = rule.names[0].toLowerCase();
57
- rule.information =
57
+ // eslint-disable-next-line dot-notation
58
+ rule["information"] =
58
59
  new URL(`${homepage}/blob/v${version}/doc/Rules.md#${name}`);
59
60
  });
60
61
  module.exports = rules;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdownlint",
3
- "version": "0.22.0",
3
+ "version": "0.25.0",
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",
@@ -13,53 +13,65 @@
13
13
  },
14
14
  "bugs": "https://github.com/DavidAnson/markdownlint/issues",
15
15
  "scripts": {
16
- "test": "tape 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",
17
- "test-cover": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 tape 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",
18
- "test-declaration": "cd example/typescript && tsc && node type-check.js",
19
- "test-extra": "node test/markdownlint-test-extra.js",
20
- "lint": "eslint --max-warnings 0 lib helpers test schema && eslint --env browser --global markdownit --global markdownlint --rule \"no-unused-vars: 0, no-extend-native: 0, max-statements: 0, no-console: 0, no-var: 0, unicorn/prefer-add-event-listener: 0, unicorn/prefer-query-selector: 0, unicorn/prefer-replace-all: 0\" demo && eslint --rule \"no-console: 0, no-invalid-this: 0, no-shadow: 0, object-property-newline: 0, node/no-missing-require: 0, node/no-extraneous-require: 0\" example",
21
- "ci": "npm run test-cover && npm run lint && npm run test-declaration",
16
+ "build-config": "npm run build-config-schema && npm run build-config-example",
17
+ "build-config-example": "node schema/build-config-example.js",
22
18
  "build-config-schema": "node schema/build-config-schema.js",
23
- "build-declaration": "tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'",
24
- "build-demo": "cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && cpy file-header.js . --rename=markdownlint-browser.js && tsc --allowJs --resolveJsonModule --outDir ../lib-es3 ../lib/markdownlint.js && cpy ../helpers/package.json ../lib-es3/helpers && browserify ../lib-es3/lib/markdownlint.js --standalone markdownlint >> markdownlint-browser.js && browserify ../lib-es3/helpers/helpers.js --standalone helpers >> markdownlint-rule-helpers-browser.js && uglifyjs markdownlint-browser.js markdownlint-rule-helpers-browser.js --compress --mangle --comments --output markdownlint-browser.min.js",
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",
25
21
  "build-example": "npm install --no-save --ignore-scripts grunt grunt-cli gulp through2",
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",
33
+ "declaration": "npm run build-declaration && npm run test-declaration",
26
34
  "example": "cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint",
27
- "clone-test-repos": "make-dir 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",
28
- "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",
29
- "lint-test-repos": "node test/markdownlint-test-repos.js",
30
- "clean-test-repos": "rimraf test-repos"
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",
37
+ "lint": "eslint --max-warnings 0 .",
38
+ "lint-test-repos": "ava --timeout=5m test/markdownlint-test-repos.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",
41
+ "test-cover": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test",
42
+ "test-declaration": "cd example/typescript && tsc && node type-check.js",
43
+ "test-extra": "ava --timeout=5m test/markdownlint-test-extra-parse.js test/markdownlint-test-extra-type.js",
44
+ "upgrade": "npx npm-check-updates --upgrade"
31
45
  },
32
46
  "engines": {
33
- "node": ">=10"
47
+ "node": ">=12"
34
48
  },
35
49
  "dependencies": {
36
- "markdown-it": "12.0.2"
50
+ "markdown-it": "12.3.0"
37
51
  },
38
52
  "devDependencies": {
39
- "@types/node": "~14.14.9",
40
- "browserify": "~17.0.0",
41
- "c8": "~7.3.5",
42
- "cpy-cli": "~3.1.1",
43
- "eslint": "~7.14.0",
44
- "eslint-plugin-jsdoc": "~30.7.8",
53
+ "ava": "~3.15.0",
54
+ "c8": "~7.10.0",
55
+ "eslint": "~8.5.0",
56
+ "eslint-plugin-jsdoc": "~37.4.0",
45
57
  "eslint-plugin-node": "~11.1.0",
46
- "eslint-plugin-unicorn": "~23.0.0",
47
- "globby": "~11.0.1",
48
- "js-yaml": "~3.14.0",
49
- "make-dir-cli": "~2.0.0",
58
+ "eslint-plugin-unicorn": "~39.0.0",
59
+ "globby": "~12.0.2",
60
+ "js-yaml": "~4.1.0",
50
61
  "markdown-it-for-inline": "~0.1.1",
51
62
  "markdown-it-sub": "~1.0.0",
52
63
  "markdown-it-sup": "~1.0.0",
53
- "markdown-it-texmath": "~0.8.0",
54
- "markdownlint-rule-helpers": "~0.12.0",
55
- "rimraf": "~3.0.2",
56
- "strip-json-comments": "~3.1.1",
57
- "tape": "~5.0.1",
58
- "tape-player": "~0.1.1",
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",
59
69
  "toml": "~3.0.0",
70
+ "ts-loader": "~9.2.6",
60
71
  "tv4": "~1.3.0",
61
- "typescript": "~4.1.2",
62
- "uglify-js": "~3.12.0"
72
+ "typescript": "~4.5.4",
73
+ "webpack": "~5.65.0",
74
+ "webpack-cli": "~4.9.1"
63
75
  },
64
76
  "keywords": [
65
77
  "markdown",
@@ -67,8 +79,5 @@
67
79
  "md",
68
80
  "CommonMark",
69
81
  "markdownlint"
70
- ],
71
- "browser": {
72
- "markdown-it": "../demo/markdown-it-stub.js"
73
- }
82
+ ]
74
83
  }
@@ -0,0 +1,266 @@
1
+ {
2
+ // Example markdownlint JSON(C) configuration with all properties set to their default value
3
+
4
+ // Default state for all rules
5
+ "default": true,
6
+
7
+ // Path to configuration file to extend
8
+ "extends": null,
9
+
10
+ // MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time
11
+ "MD001": true,
12
+
13
+ // MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading
14
+ "MD002": {
15
+ // Heading level
16
+ "level": 1
17
+ },
18
+
19
+ // MD003/heading-style/header-style - Heading style
20
+ "MD003": {
21
+ // Heading style
22
+ "style": "consistent"
23
+ },
24
+
25
+ // MD004/ul-style - Unordered list style
26
+ "MD004": {
27
+ // List style
28
+ "style": "consistent"
29
+ },
30
+
31
+ // MD005/list-indent - Inconsistent indentation for list items at the same level
32
+ "MD005": true,
33
+
34
+ // MD006/ul-start-left - Consider starting bulleted lists at the beginning of the line
35
+ "MD006": true,
36
+
37
+ // MD007/ul-indent - Unordered list indentation
38
+ "MD007": {
39
+ // Spaces for indent
40
+ "indent": 2,
41
+ // Whether to indent the first level of the list
42
+ "start_indented": false,
43
+ // Spaces for first level indent (when start_indented is set)
44
+ "start_indent": 2
45
+ },
46
+
47
+ // MD009/no-trailing-spaces - Trailing spaces
48
+ "MD009": {
49
+ // Spaces for line break
50
+ "br_spaces": 2,
51
+ // Allow spaces for empty lines in list items
52
+ "list_item_empty_lines": false,
53
+ // Include unnecessary breaks
54
+ "strict": false
55
+ },
56
+
57
+ // MD010/no-hard-tabs - Hard tabs
58
+ "MD010": {
59
+ // Include code blocks
60
+ "code_blocks": true,
61
+ // Number of spaces for each hard tab
62
+ "spaces_per_tab": 1
63
+ },
64
+
65
+ // MD011/no-reversed-links - Reversed link syntax
66
+ "MD011": true,
67
+
68
+ // MD012/no-multiple-blanks - Multiple consecutive blank lines
69
+ "MD012": {
70
+ // Consecutive blank lines
71
+ "maximum": 1
72
+ },
73
+
74
+ // MD013/line-length - Line length
75
+ "MD013": {
76
+ // Number of characters
77
+ "line_length": 80,
78
+ // Number of characters for headings
79
+ "heading_line_length": 80,
80
+ // Number of characters for code blocks
81
+ "code_block_line_length": 80,
82
+ // Include code blocks
83
+ "code_blocks": true,
84
+ // Include tables
85
+ "tables": true,
86
+ // Include headings
87
+ "headings": true,
88
+ // Include headings
89
+ "headers": true,
90
+ // Strict length checking
91
+ "strict": false,
92
+ // Stern length checking
93
+ "stern": false
94
+ },
95
+
96
+ // MD014/commands-show-output - Dollar signs used before commands without showing output
97
+ "MD014": true,
98
+
99
+ // MD018/no-missing-space-atx - No space after hash on atx style heading
100
+ "MD018": true,
101
+
102
+ // MD019/no-multiple-space-atx - Multiple spaces after hash on atx style heading
103
+ "MD019": true,
104
+
105
+ // MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style heading
106
+ "MD020": true,
107
+
108
+ // MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading
109
+ "MD021": true,
110
+
111
+ // MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines
112
+ "MD022": {
113
+ // Blank lines above heading
114
+ "lines_above": 1,
115
+ // Blank lines below heading
116
+ "lines_below": 1
117
+ },
118
+
119
+ // MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line
120
+ "MD023": true,
121
+
122
+ // MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
123
+ "MD024": {
124
+ // Only check sibling headings
125
+ "allow_different_nesting": false,
126
+ // Only check sibling headings
127
+ "siblings_only": false
128
+ },
129
+
130
+ // MD025/single-title/single-h1 - Multiple top-level headings in the same document
131
+ "MD025": {
132
+ // Heading level
133
+ "level": 1,
134
+ // RegExp for matching title in front matter
135
+ "front_matter_title": "^\\s*title\\s*[:=]"
136
+ },
137
+
138
+ // MD026/no-trailing-punctuation - Trailing punctuation in heading
139
+ "MD026": {
140
+ // Punctuation characters
141
+ "punctuation": ".,;:!。,;:!"
142
+ },
143
+
144
+ // MD027/no-multiple-space-blockquote - Multiple spaces after blockquote symbol
145
+ "MD027": true,
146
+
147
+ // MD028/no-blanks-blockquote - Blank line inside blockquote
148
+ "MD028": true,
149
+
150
+ // MD029/ol-prefix - Ordered list item prefix
151
+ "MD029": {
152
+ // List style
153
+ "style": "one_or_ordered"
154
+ },
155
+
156
+ // MD030/list-marker-space - Spaces after list markers
157
+ "MD030": {
158
+ // Spaces for single-line unordered list items
159
+ "ul_single": 1,
160
+ // Spaces for single-line ordered list items
161
+ "ol_single": 1,
162
+ // Spaces for multi-line unordered list items
163
+ "ul_multi": 1,
164
+ // Spaces for multi-line ordered list items
165
+ "ol_multi": 1
166
+ },
167
+
168
+ // MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines
169
+ "MD031": {
170
+ // Include list items
171
+ "list_items": true
172
+ },
173
+
174
+ // MD032/blanks-around-lists - Lists should be surrounded by blank lines
175
+ "MD032": true,
176
+
177
+ // MD033/no-inline-html - Inline HTML
178
+ "MD033": {
179
+ // Allowed elements
180
+ "allowed_elements": []
181
+ },
182
+
183
+ // MD034/no-bare-urls - Bare URL used
184
+ "MD034": true,
185
+
186
+ // MD035/hr-style - Horizontal rule style
187
+ "MD035": {
188
+ // Horizontal rule style
189
+ "style": "consistent"
190
+ },
191
+
192
+ // MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading
193
+ "MD036": {
194
+ // Punctuation characters
195
+ "punctuation": ".,;:!?。,;:!?"
196
+ },
197
+
198
+ // MD037/no-space-in-emphasis - Spaces inside emphasis markers
199
+ "MD037": true,
200
+
201
+ // MD038/no-space-in-code - Spaces inside code span elements
202
+ "MD038": true,
203
+
204
+ // MD039/no-space-in-links - Spaces inside link text
205
+ "MD039": true,
206
+
207
+ // MD040/fenced-code-language - Fenced code blocks should have a language specified
208
+ "MD040": true,
209
+
210
+ // MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
211
+ "MD041": {
212
+ // Heading level
213
+ "level": 1,
214
+ // RegExp for matching title in front matter
215
+ "front_matter_title": "^\\s*title\\s*[:=]"
216
+ },
217
+
218
+ // MD042/no-empty-links - No empty links
219
+ "MD042": true,
220
+
221
+ // MD043/required-headings/required-headers - Required heading structure
222
+ "MD043": {
223
+ // List of headings
224
+ "headings": [],
225
+ // List of headings
226
+ "headers": []
227
+ },
228
+
229
+ // MD044/proper-names - Proper names should have the correct capitalization
230
+ "MD044": {
231
+ // List of proper names
232
+ "names": [],
233
+ // Include code blocks
234
+ "code_blocks": true
235
+ },
236
+
237
+ // MD045/no-alt-text - Images should have alternate text (alt text)
238
+ "MD045": true,
239
+
240
+ // MD046/code-block-style - Code block style
241
+ "MD046": {
242
+ // Block style
243
+ "style": "consistent"
244
+ },
245
+
246
+ // MD047/single-trailing-newline - Files should end with a single newline character
247
+ "MD047": true,
248
+
249
+ // MD048/code-fence-style - Code fence style
250
+ "MD048": {
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
264
+ "style": "consistent"
265
+ }
266
+ }