-
Notifications
You must be signed in to change notification settings - Fork 112
/
.markdownlint-cli2.yaml
132 lines (132 loc) · 4.58 KB
/
.markdownlint-cli2.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Available configuration options: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
config:
MD003:
style: atx
MD004:
style: dash
MD009:
br_spaces: 0
MD013: false
MD024:
siblings_only: true
MD025:
front_matter_title: ""
MD026:
# Allow headings to end with `!`
punctuation: ".,;:。,;:"
MD029:
style: ordered
MD033: false
MD035:
style: ---
MD046:
style: fenced
MD048:
style: backtick
MD049:
style: underscore
MD050:
style: asterisk
MD053: false
MD054:
# A link to [keyword][].
collapsed: false
# A link to [keyword].
# [keyword]: <https://docs.fabricmc.net/>
shortcut: false
url_inline: false
MD055:
style: leading_and_trailing
search-replace:
rules:
- name: missing-heading-anchor
message: "Add anchors to headings. Use lowercase characters, numbers and dashes"
information: https://vitepress.dev/guide/markdown#header-anchors
searchPattern: "/^#+ .*$(?<!\\{#[a-z0-9-]+\\})/gm"
searchScope: text
- name: missing-space-before-anchor
message: "Add a space before the heading's anchor."
information: https://vitepress.dev/guide/markdown#header-anchors
searchPattern: "/^(#+ .*)(?<! )(\\{#[a-z0-9-]+\\})$/gm"
replace: "$1 $2"
searchScope: text
- name: no-absolute-links
message: "Don't use absolute links"
searchPattern: "/\\[[^\\]]*\\]\\(/(?!assets|public|reference)[^\\)]*\\)/g"
searchScope: text
- name: no-curly-quotes
message: "Don't use curly quotes"
search: [“, ”, ‘, ’]
replace: ['"', '"', "'", "'"]
searchScope: text
- name: no-file-extension-in-links
message: "Don't add the file extension to links"
information: https://vitepress.dev/guide/routing#linking-between-pages
searchPattern: "/(\\[[^\\]]*\\])\\(([^\\)]*)\\.(?:md|html)((?:#[a-z0-9-]+)?)\\)/g"
replace: "$1($2$3)"
searchScope: text
- name: no-github-flavored-alerts
message: "Don't use GitHub-favored Alerts"
information: https://vitepress.dev/guide/markdown#custom-containers
searchPattern:
- "/^> \\[!NOTE\\]/gm"
- "/^> \\[!TIP\\]/gm"
- "/^> \\[!IMPORTANT\\]/gm"
- "/^> \\[!WARNING\\]/gm"
- "/^> \\[!CAUTION\\]/gm"
replace:
- "::: info"
- "::: tip"
- "::: warning IMPORTANT"
- "::: warning"
- "::: danger"
searchScope: text
- name: no-images-in-text
message: "Don't place images in text"
searchPattern: "/(?:(?<!^)!\\[[^\\]]*\\]\\([^\\)]*\\).*$)|(?:^!\\[[^\\]]*\\]\\([^\\)]*\\)(?!$))/gm"
searchScope: text
- name: no-invalid-containers
message: "Don't use invalid containers"
information: https://vitepress.dev/guide/markdown#custom-containers
searchPattern: "/^::: (?!(?:info|tip|warning|danger|details|raw|code-group|v-pre)(?: |$))/gm"
replace: "::: info "
searchScope: text
- name: no-links-to-public
message: "Don't add /public to links"
information: https://vitepress.dev/guide/asset-handling#the-public-directory
searchPattern: "/(\\[[^\\]]*\\]\\()/public([^\\)]*\\))/g"
replace: "$1$2"
searchScope: text
- name: no-multiple-spaces
message: "Don't use multiple spaces"
searchPattern: "/(?<!\\n|\\|| ) +(?! |\\|)/g"
replace: " "
searchScope: text
- name: no-nbsp
message: "Don't use no-break spaces"
searchPattern: "/\\xa0/gu"
replace: " "
searchScope: all
- name: no-padding-for-keybinds
message: "Don't put spaces around pluses in keybinds"
searchPattern: "/(<\\/kbd *>)(?:(?: +\\+ *)|(?:\\+ +))(<kbd[^>]*>)/g"
replace: "$1+$2"
searchScope: text
- name: no-punctuation-after-images
message: "Don't place punctuation after images"
searchPattern: "/^(!\\[[^\\]]*\\]\\([^\\)]*\\))[.,:;?!]+/gm"
replace: "$1"
searchScope: text
- name: no-punctuation-in-links
message: "Don't place punctuation inside of links"
searchPattern: "/(?<!@)\\[([^\\]]*)([.,:;?!]+)\\]\\(([^\\)]*)\\)/g"
replace: "[$1]($3)$2"
searchScope: text
- name: no-trailing-whitespace
message: "Don't use trailing whitespace"
searchPattern: "/ +$/gm"
replace: ""
searchScope: code
customRules:
- ./node_modules/markdownlint-rule-search-replace/rule.js
- ./node_modules/markdownlint-rule-titlecase/rule.js