markdownlint 0.23.0 → 0.23.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/README.md +1 -0
- package/demo/markdownlint-browser.js +7 -3
- package/lib/markdownlint.js +9 -1
- package/package.json +1 -1
- package/schema/build-config-example.js +0 -53
- package/schema/build-config-schema.js +0 -420
package/README.md
CHANGED
|
@@ -940,6 +940,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
|
940
940
|
* 0.23.0 - Add comprehensive example `.markdownlint.jsonc`/`.markdownlint.yaml` files, add fix
|
|
941
941
|
information for MD004/ul-style, improve MD018/MD019/MD020/MD021/MD037/MD041, improve
|
|
942
942
|
HTML comment handling, update test runner and test suite, update dependencies.
|
|
943
|
+
* 0.23.1 - Work around lack of webpack support for dynamic calls to `require` (`.resolve`).
|
|
943
944
|
|
|
944
945
|
[npm-image]: https://img.shields.io/npm/v/markdownlint.svg
|
|
945
946
|
[npm-url]: https://www.npmjs.com/package/markdownlint
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! markdownlint 0.23.
|
|
1
|
+
/*! markdownlint 0.23.1 https://github.com/DavidAnson/markdownlint @license MIT */
|
|
2
2
|
var markdownlint;markdownlint =
|
|
3
3
|
/******/ (() => { // webpackBootstrap
|
|
4
4
|
/******/ var __webpack_modules__ = ({
|
|
@@ -783,6 +783,10 @@ var markdownIt = __webpack_require__(/*! markdown-it */ "markdown-it");
|
|
|
783
783
|
var rules = __webpack_require__(/*! ./rules */ "../lib/rules.js");
|
|
784
784
|
var helpers = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
|
|
785
785
|
var cache = __webpack_require__(/*! ./cache */ "../lib/cache.js");
|
|
786
|
+
// @ts-ignore
|
|
787
|
+
// eslint-disable-next-line camelcase, max-len, no-inline-comments, no-undef
|
|
788
|
+
var dynamicRequire = (typeof require === "undefined") ? __webpack_require__("../lib sync recursive") : /* c8 ignore next */ require;
|
|
789
|
+
// Capture native require implementation for dynamic loading of modules
|
|
786
790
|
var deprecatedRuleNames = ["MD002", "MD006"];
|
|
787
791
|
/**
|
|
788
792
|
* Validate the list of rules for structure and reuse.
|
|
@@ -1616,7 +1620,7 @@ function resolveConfigExtends(configFile, referenceId) {
|
|
|
1616
1620
|
// If not a file or fs.statSync throws, try require.resolve
|
|
1617
1621
|
}
|
|
1618
1622
|
try {
|
|
1619
|
-
return
|
|
1623
|
+
return dynamicRequire.resolve(referenceId, { "paths": [configFileDirname] });
|
|
1620
1624
|
}
|
|
1621
1625
|
catch (_b) {
|
|
1622
1626
|
// If require.resolve throws, return resolvedExtendsFile
|
|
@@ -4015,7 +4019,7 @@ module.exports = rules;
|
|
|
4015
4019
|
/***/ ((module) => {
|
|
4016
4020
|
|
|
4017
4021
|
"use strict";
|
|
4018
|
-
module.exports = JSON.parse("{\"name\":\"markdownlint\",\"version\":\"0.23.
|
|
4022
|
+
module.exports = JSON.parse("{\"name\":\"markdownlint\",\"version\":\"0.23.1\",\"description\":\"A Node.js style checker and lint tool for Markdown/CommonMark files.\",\"main\":\"lib/markdownlint.js\",\"types\":\"lib/markdownlint.d.ts\",\"author\":\"David Anson (https://dlaa.me/)\",\"license\":\"MIT\",\"homepage\":\"https://github.com/DavidAnson/markdownlint\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/DavidAnson/markdownlint.git\"},\"bugs\":\"https://github.com/DavidAnson/markdownlint/issues\",\"scripts\":{\"build-config\":\"npm run build-config-schema && npm run build-config-example\",\"build-config-example\":\"node schema/build-config-example.js\",\"build-config-schema\":\"node schema/build-config-schema.js\",\"build-declaration\":\"tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'\",\"build-demo\":\"cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && webpack --no-stats\",\"build-example\":\"npm install --no-save --ignore-scripts grunt grunt-cli gulp through2\",\"ci\":\"npm-run-all --continue-on-error --parallel test-cover lint declaration build-config build-demo && git diff --exit-code\",\"clean-test-repos\":\"rimraf test-repos\",\"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\",\"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\",\"declaration\":\"npm run build-declaration && npm run test-declaration\",\"example\":\"cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint\",\"lint\":\"eslint --max-warnings 0 .\",\"lint-test-repos\":\"ava --timeout=5m test/markdownlint-test-repos.js\",\"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\",\"test-cover\":\"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test\",\"test-declaration\":\"cd example/typescript && tsc && node type-check.js\",\"test-extra\":\"ava --timeout=5m test/markdownlint-test-extra.js\"},\"engines\":{\"node\":\">=10\"},\"dependencies\":{\"markdown-it\":\"12.0.4\"},\"devDependencies\":{\"ava\":\"~3.15.0\",\"c8\":\"~7.5.0\",\"cpy-cli\":\"~3.1.1\",\"eslint\":\"~7.19.0\",\"eslint-plugin-jsdoc\":\"~31.6.0\",\"eslint-plugin-node\":\"~11.1.0\",\"eslint-plugin-unicorn\":\"~27.0.0\",\"globby\":\"~11.0.2\",\"js-yaml\":\"~4.0.0\",\"markdown-it-for-inline\":\"~0.1.1\",\"markdown-it-sub\":\"~1.0.0\",\"markdown-it-sup\":\"~1.0.0\",\"markdown-it-texmath\":\"~0.8.0\",\"markdownlint-rule-helpers\":\"~0.13.0\",\"npm-run-all\":\"~4.1.5\",\"rimraf\":\"~3.0.2\",\"strip-json-comments\":\"~3.1.1\",\"toml\":\"~3.0.0\",\"ts-loader\":\"~8.0.15\",\"tv4\":\"~1.3.0\",\"typescript\":\"~4.1.3\",\"webpack\":\"~5.21.1\",\"webpack-cli\":\"~4.5.0\"},\"keywords\":[\"markdown\",\"lint\",\"md\",\"CommonMark\",\"markdownlint\"]}");
|
|
4019
4023
|
|
|
4020
4024
|
/***/ }),
|
|
4021
4025
|
|
package/lib/markdownlint.js
CHANGED
|
@@ -10,6 +10,11 @@ const rules = require("./rules");
|
|
|
10
10
|
const helpers = require("../helpers");
|
|
11
11
|
const cache = require("./cache");
|
|
12
12
|
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
// eslint-disable-next-line camelcase, max-len, no-inline-comments, no-undef
|
|
15
|
+
const dynamicRequire = (typeof __non_webpack_require__ === "undefined") ? require : /* c8 ignore next */ __non_webpack_require__;
|
|
16
|
+
// Capture native require implementation for dynamic loading of modules
|
|
17
|
+
|
|
13
18
|
const deprecatedRuleNames = [ "MD002", "MD006" ];
|
|
14
19
|
|
|
15
20
|
/**
|
|
@@ -936,7 +941,10 @@ function resolveConfigExtends(configFile, referenceId) {
|
|
|
936
941
|
// If not a file or fs.statSync throws, try require.resolve
|
|
937
942
|
}
|
|
938
943
|
try {
|
|
939
|
-
return
|
|
944
|
+
return dynamicRequire.resolve(
|
|
945
|
+
referenceId,
|
|
946
|
+
{ "paths": [ configFileDirname ] }
|
|
947
|
+
);
|
|
940
948
|
} catch {
|
|
941
949
|
// If require.resolve throws, return resolvedExtendsFile
|
|
942
950
|
}
|
package/package.json
CHANGED
|
@@ -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
|
-
);
|
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const path = require("path");
|
|
7
|
-
const rules = require("../lib/rules");
|
|
8
|
-
|
|
9
|
-
// Schema scaffolding
|
|
10
|
-
const schema = {
|
|
11
|
-
"title": "Markdownlint configuration schema",
|
|
12
|
-
"type": "object",
|
|
13
|
-
"properties": {
|
|
14
|
-
"default": {
|
|
15
|
-
"description": "Default state for all rules",
|
|
16
|
-
"type": "boolean",
|
|
17
|
-
"default": true
|
|
18
|
-
},
|
|
19
|
-
"extends": {
|
|
20
|
-
"description": "Path to configuration file to extend",
|
|
21
|
-
"type": [
|
|
22
|
-
"string",
|
|
23
|
-
"null"
|
|
24
|
-
],
|
|
25
|
-
"default": null
|
|
26
|
-
},
|
|
27
|
-
"$schema": {
|
|
28
|
-
"description": "JSON Schema URI (used by some editors)",
|
|
29
|
-
"type": "string",
|
|
30
|
-
"default": "https://raw.githubusercontent.com/DavidAnson/markdownlint" +
|
|
31
|
-
"/main/schema/markdownlint-config-schema.json"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"additionalProperties": {
|
|
35
|
-
"type:": [
|
|
36
|
-
"boolean",
|
|
37
|
-
"object"
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const tags = {};
|
|
42
|
-
|
|
43
|
-
// Add rules
|
|
44
|
-
rules.forEach(function forRule(rule) {
|
|
45
|
-
rule.tags.forEach(function forTag(tag) {
|
|
46
|
-
const tagRules = tags[tag] || [];
|
|
47
|
-
tagRules.push(rule.names[0]);
|
|
48
|
-
tags[tag] = tagRules;
|
|
49
|
-
});
|
|
50
|
-
const scheme = {
|
|
51
|
-
"description": rule.names.join("/") + " - " + rule.description,
|
|
52
|
-
"type": "boolean",
|
|
53
|
-
"default": true
|
|
54
|
-
};
|
|
55
|
-
let custom = true;
|
|
56
|
-
switch (rule.names[0]) {
|
|
57
|
-
case "MD002":
|
|
58
|
-
scheme.properties = {
|
|
59
|
-
"level": {
|
|
60
|
-
"description": "Heading level",
|
|
61
|
-
"type": "integer",
|
|
62
|
-
"default": 1
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
break;
|
|
66
|
-
case "MD003":
|
|
67
|
-
scheme.properties = {
|
|
68
|
-
"style": {
|
|
69
|
-
"description": "Heading style",
|
|
70
|
-
"type": "string",
|
|
71
|
-
"enum": [
|
|
72
|
-
"consistent",
|
|
73
|
-
"atx",
|
|
74
|
-
"atx_closed",
|
|
75
|
-
"setext",
|
|
76
|
-
"setext_with_atx",
|
|
77
|
-
"setext_with_atx_closed"
|
|
78
|
-
],
|
|
79
|
-
"default": "consistent"
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
break;
|
|
83
|
-
case "MD004":
|
|
84
|
-
scheme.properties = {
|
|
85
|
-
"style": {
|
|
86
|
-
"description": "List style",
|
|
87
|
-
"type": "string",
|
|
88
|
-
"enum": [
|
|
89
|
-
"consistent",
|
|
90
|
-
"asterisk",
|
|
91
|
-
"plus",
|
|
92
|
-
"dash",
|
|
93
|
-
"sublist"
|
|
94
|
-
],
|
|
95
|
-
"default": "consistent"
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
break;
|
|
99
|
-
case "MD007":
|
|
100
|
-
scheme.properties = {
|
|
101
|
-
"indent": {
|
|
102
|
-
"description": "Spaces for indent",
|
|
103
|
-
"type": "integer",
|
|
104
|
-
"default": 2
|
|
105
|
-
},
|
|
106
|
-
"start_indented": {
|
|
107
|
-
"description": "Whether to indent the first level of the list",
|
|
108
|
-
"type": "boolean",
|
|
109
|
-
"default": false
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
break;
|
|
113
|
-
case "MD009":
|
|
114
|
-
scheme.properties = {
|
|
115
|
-
"br_spaces": {
|
|
116
|
-
"description": "Spaces for line break",
|
|
117
|
-
"type": "integer",
|
|
118
|
-
"default": 2
|
|
119
|
-
},
|
|
120
|
-
"list_item_empty_lines": {
|
|
121
|
-
"description": "Allow spaces for empty lines in list items",
|
|
122
|
-
"type": "boolean",
|
|
123
|
-
"default": false
|
|
124
|
-
},
|
|
125
|
-
"strict": {
|
|
126
|
-
"description": "Include unnecessary breaks",
|
|
127
|
-
"type": "boolean",
|
|
128
|
-
"default": false
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
break;
|
|
132
|
-
case "MD010":
|
|
133
|
-
scheme.properties = {
|
|
134
|
-
"code_blocks": {
|
|
135
|
-
"description": "Include code blocks",
|
|
136
|
-
"type": "boolean",
|
|
137
|
-
"default": true
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
break;
|
|
141
|
-
case "MD012":
|
|
142
|
-
scheme.properties = {
|
|
143
|
-
"maximum": {
|
|
144
|
-
"description": "Consecutive blank lines",
|
|
145
|
-
"type": "integer",
|
|
146
|
-
"default": 1
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
break;
|
|
150
|
-
case "MD013":
|
|
151
|
-
scheme.properties = {
|
|
152
|
-
"line_length": {
|
|
153
|
-
"description": "Number of characters",
|
|
154
|
-
"type": "integer",
|
|
155
|
-
"default": 80
|
|
156
|
-
},
|
|
157
|
-
"heading_line_length": {
|
|
158
|
-
"description": "Number of characters for headings",
|
|
159
|
-
"type": "integer",
|
|
160
|
-
"default": 80
|
|
161
|
-
},
|
|
162
|
-
"code_block_line_length": {
|
|
163
|
-
"description": "Number of characters for code blocks",
|
|
164
|
-
"type": "integer",
|
|
165
|
-
"default": 80
|
|
166
|
-
},
|
|
167
|
-
"code_blocks": {
|
|
168
|
-
"description": "Include code blocks",
|
|
169
|
-
"type": "boolean",
|
|
170
|
-
"default": true
|
|
171
|
-
},
|
|
172
|
-
"tables": {
|
|
173
|
-
"description": "Include tables",
|
|
174
|
-
"type": "boolean",
|
|
175
|
-
"default": true
|
|
176
|
-
},
|
|
177
|
-
"headings": {
|
|
178
|
-
"description": "Include headings",
|
|
179
|
-
"type": "boolean",
|
|
180
|
-
"default": true
|
|
181
|
-
},
|
|
182
|
-
"headers": {
|
|
183
|
-
"description": "Include headings",
|
|
184
|
-
"type": "boolean",
|
|
185
|
-
"default": true
|
|
186
|
-
},
|
|
187
|
-
"strict": {
|
|
188
|
-
"description": "Strict length checking",
|
|
189
|
-
"type": "boolean",
|
|
190
|
-
"default": false
|
|
191
|
-
},
|
|
192
|
-
"stern": {
|
|
193
|
-
"description": "Stern length checking",
|
|
194
|
-
"type": "boolean",
|
|
195
|
-
"default": false
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
break;
|
|
199
|
-
case "MD022":
|
|
200
|
-
scheme.properties = {
|
|
201
|
-
"lines_above": {
|
|
202
|
-
"description": "Blank lines above heading",
|
|
203
|
-
"type": "integer",
|
|
204
|
-
"default": 1
|
|
205
|
-
},
|
|
206
|
-
"lines_below": {
|
|
207
|
-
"description": "Blank lines below heading",
|
|
208
|
-
"type": "integer",
|
|
209
|
-
"default": 1
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
break;
|
|
213
|
-
case "MD024":
|
|
214
|
-
scheme.properties = {
|
|
215
|
-
"allow_different_nesting": {
|
|
216
|
-
"description": "Only check sibling headings",
|
|
217
|
-
"type": "boolean",
|
|
218
|
-
"default": false
|
|
219
|
-
},
|
|
220
|
-
"siblings_only": {
|
|
221
|
-
"description": "Only check sibling headings",
|
|
222
|
-
"type": "boolean",
|
|
223
|
-
"default": false
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
break;
|
|
227
|
-
case "MD026":
|
|
228
|
-
scheme.properties = {
|
|
229
|
-
"punctuation": {
|
|
230
|
-
"description": "Punctuation characters",
|
|
231
|
-
"type": "string",
|
|
232
|
-
"default": ".,;:!。,;:!"
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
break;
|
|
236
|
-
case "MD036":
|
|
237
|
-
scheme.properties = {
|
|
238
|
-
"punctuation": {
|
|
239
|
-
"description": "Punctuation characters",
|
|
240
|
-
"type": "string",
|
|
241
|
-
"default": ".,;:!?。,;:!?"
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
break;
|
|
245
|
-
case "MD029":
|
|
246
|
-
scheme.properties = {
|
|
247
|
-
"style": {
|
|
248
|
-
"description": "List style",
|
|
249
|
-
"type": "string",
|
|
250
|
-
"enum": [
|
|
251
|
-
"one",
|
|
252
|
-
"ordered",
|
|
253
|
-
"one_or_ordered",
|
|
254
|
-
"zero"
|
|
255
|
-
],
|
|
256
|
-
"default": "one_or_ordered"
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
break;
|
|
260
|
-
case "MD030":
|
|
261
|
-
scheme.properties = {
|
|
262
|
-
"ul_single": {
|
|
263
|
-
"description": "Spaces for single-line unordered list items",
|
|
264
|
-
"type": "integer",
|
|
265
|
-
"default": 1
|
|
266
|
-
},
|
|
267
|
-
"ol_single": {
|
|
268
|
-
"description": "Spaces for single-line ordered list items",
|
|
269
|
-
"type": "integer",
|
|
270
|
-
"default": 1
|
|
271
|
-
},
|
|
272
|
-
"ul_multi": {
|
|
273
|
-
"description": "Spaces for multi-line unordered list items",
|
|
274
|
-
"type": "integer",
|
|
275
|
-
"default": 1
|
|
276
|
-
},
|
|
277
|
-
"ol_multi": {
|
|
278
|
-
"description": "Spaces for multi-line ordered list items",
|
|
279
|
-
"type": "integer",
|
|
280
|
-
"default": 1
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
break;
|
|
284
|
-
case "MD031":
|
|
285
|
-
scheme.properties = {
|
|
286
|
-
"list_items": {
|
|
287
|
-
"description": "Include list items",
|
|
288
|
-
"type": "boolean",
|
|
289
|
-
"default": true
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
break;
|
|
293
|
-
case "MD033":
|
|
294
|
-
scheme.properties = {
|
|
295
|
-
"allowed_elements": {
|
|
296
|
-
"description": "Allowed elements",
|
|
297
|
-
"type": "array",
|
|
298
|
-
"items": {
|
|
299
|
-
"type": "string"
|
|
300
|
-
},
|
|
301
|
-
"default": []
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
break;
|
|
305
|
-
case "MD035":
|
|
306
|
-
scheme.properties = {
|
|
307
|
-
"style": {
|
|
308
|
-
"description": "Horizontal rule style",
|
|
309
|
-
"type": "string",
|
|
310
|
-
"default": "consistent"
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
break;
|
|
314
|
-
case "MD025":
|
|
315
|
-
case "MD041":
|
|
316
|
-
scheme.properties = {
|
|
317
|
-
"level": {
|
|
318
|
-
"description": "Heading level",
|
|
319
|
-
"type": "integer",
|
|
320
|
-
"default": 1
|
|
321
|
-
},
|
|
322
|
-
"front_matter_title": {
|
|
323
|
-
"description": "RegExp for matching title in front matter",
|
|
324
|
-
"type": "string",
|
|
325
|
-
"default": "^\\s*title\\s*[:=]"
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
break;
|
|
329
|
-
case "MD043":
|
|
330
|
-
scheme.properties = {
|
|
331
|
-
"headings": {
|
|
332
|
-
"description": "List of headings",
|
|
333
|
-
"type": "array",
|
|
334
|
-
"items": {
|
|
335
|
-
"type": "string"
|
|
336
|
-
},
|
|
337
|
-
"default": []
|
|
338
|
-
},
|
|
339
|
-
"headers": {
|
|
340
|
-
"description": "List of headings",
|
|
341
|
-
"type": "array",
|
|
342
|
-
"items": {
|
|
343
|
-
"type": "string"
|
|
344
|
-
},
|
|
345
|
-
"default": []
|
|
346
|
-
}
|
|
347
|
-
};
|
|
348
|
-
break;
|
|
349
|
-
case "MD044":
|
|
350
|
-
scheme.properties = {
|
|
351
|
-
"names": {
|
|
352
|
-
"description": "List of proper names",
|
|
353
|
-
"type": "array",
|
|
354
|
-
"items": {
|
|
355
|
-
"type": "string"
|
|
356
|
-
},
|
|
357
|
-
"default": []
|
|
358
|
-
},
|
|
359
|
-
"code_blocks": {
|
|
360
|
-
"description": "Include code blocks",
|
|
361
|
-
"type": "boolean",
|
|
362
|
-
"default": true
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
break;
|
|
366
|
-
case "MD046":
|
|
367
|
-
scheme.properties = {
|
|
368
|
-
"style": {
|
|
369
|
-
"description": "Block style",
|
|
370
|
-
"type": "string",
|
|
371
|
-
"enum": [
|
|
372
|
-
"consistent",
|
|
373
|
-
"fenced",
|
|
374
|
-
"indented"
|
|
375
|
-
],
|
|
376
|
-
"default": "consistent"
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
|
-
break;
|
|
380
|
-
case "MD048":
|
|
381
|
-
scheme.properties = {
|
|
382
|
-
"style": {
|
|
383
|
-
"description": "Code fence syle",
|
|
384
|
-
"type": "string",
|
|
385
|
-
"enum": [
|
|
386
|
-
"consistent",
|
|
387
|
-
"backtick",
|
|
388
|
-
"tilde"
|
|
389
|
-
],
|
|
390
|
-
"default": "consistent"
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
break;
|
|
394
|
-
default:
|
|
395
|
-
custom = false;
|
|
396
|
-
break;
|
|
397
|
-
}
|
|
398
|
-
if (custom) {
|
|
399
|
-
// @ts-ignore
|
|
400
|
-
scheme.type = [ "boolean", "object" ];
|
|
401
|
-
scheme.additionalProperties = false;
|
|
402
|
-
}
|
|
403
|
-
rule.names.forEach(function forName(name) {
|
|
404
|
-
schema.properties[name] = scheme;
|
|
405
|
-
});
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
// Add tags
|
|
409
|
-
Object.keys(tags).forEach(function forTag(tag) {
|
|
410
|
-
const scheme = {
|
|
411
|
-
"description": tag + " - " + tags[tag].join(", "),
|
|
412
|
-
"type": "boolean",
|
|
413
|
-
"default": true
|
|
414
|
-
};
|
|
415
|
-
schema.properties[tag] = scheme;
|
|
416
|
-
});
|
|
417
|
-
|
|
418
|
-
// Write schema
|
|
419
|
-
const schemaFile = path.join(__dirname, "markdownlint-config-schema.json");
|
|
420
|
-
fs.writeFileSync(schemaFile, JSON.stringify(schema, null, " "));
|