-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlint-markdown.mjs
63 lines (46 loc) · 1.49 KB
/
lint-markdown.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import markdownlint from "markdownlint";
import { globby } from "globby";
import relativeLinksRule from "markdownlint-rule-relative-links";
const files = await globby(["**/*.md", "!**/node_modules/**"]);
const result = markdownlint.sync({
config: {
default: true,
// Disable unordered list indentation rule, allowing flexible list indentation
MD007: false,
// Allow multiple consecutive blank lines
MD012: false,
// Disable line length limit, allowing lines to exceed default character limits
MD013: false,
// Allow multiple headings with the same content
MD024: false,
MD029: {
style: "ordered",
},
// Disable blank lines required around lists
MD032: false,
// Allow inline HTML within Markdown content
MD033: false,
// Disable rule that flags bare URLs without angle brackets or proper linking
MD034: false,
// Allow documents to start without a top-level heading (e.g., '# Title')
MD041: false,
// Disable rule that flags using 'bold' style instead of headers
MD045: false,
// Allow link reference definitions without using them in the document
MD046: false,
// Disable rule that flags duplicate link definitions
MD047: false,
"relative-links": true
},
customRules: [
relativeLinksRule,
],
files,
resultVersion: 1,
});
const resultString = result.toString();
const returnCode = resultString ? 1 : 0;
if (resultString) {
console.error(resultString);
}
process.exit(returnCode);