forked from FabricMC/fabric-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.markdownlint-cli2.yaml
More file actions
171 lines (171 loc) · 6.16 KB
/
.markdownlint-cli2.yaml
File metadata and controls
171 lines (171 loc) · 6.16 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Available configuration options: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
config:
max-one-sentence-per-line:
ignored_words:
MD003:
style: atx
MD004:
style: dash
MD009:
br_spaces: 0
MD013: false
MD024:
siblings_only: true
MD026:
# Allow headings to end with `!`
punctuation: ".,;:。,;:"
MD029:
style: ordered
MD033:
allowed_elements:
- audio
- Badge
- ChoiceComponent
- ColorSwatch
- DownloadEntry
- kbd
- source
- u
- VideoPlayer
MD035:
# This is not made redundant by `no-horizontal-rules`, as the latter relies on this
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-newline-before-triple-colon
message: "Add an empty line before ::: and == lines"
information: https://github.com/FabricMC/fabric-docs/issues/459
searchPattern: "/(?<!\\n\\n)^((?::{3,}|={2,}).*)$/gm"
replace: "\n$1"
searchScope: text
- name: missing-newline-after-triple-colon
message: "Add an empty line after ::: and == lines"
information: https://github.com/FabricMC/fabric-docs/issues/459
searchPattern: "/^((?::{3,}|={2,}).*)$(?!\\n\\n)/gm"
replace: "$1\n"
searchScope: text
- name: missing-space-after-container
message: "Add a space between ::: or == and the title"
searchPattern: "/^((?::{3,}|={2,}))(?![ :])(.+)$/gm"
replace: "$1 $2"
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-horizontal-rules
message: "Don't use horizontal rules"
searchPattern: "/^\\*{3}$/gm"
replace: ""
searchScope: text
- name: no-github-flavored-alerts
message: "Don't use GitHub-flavored 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: "/^(:{3,}) (?!(?:info|tip|warning|danger|details|raw|code-group|v-pre|tab|tabs)(?: |$))/gim"
replace: "$1 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-no-break-spaces
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-punctuation-in-lists
message: "Don't add trailing punctuation in lists"
searchPattern: "/^( *- .*)[^a-z0-9?!`\"\\)]$/gi"
replace: "$1"
searchScope: text
- name: no-trailing-whitespace
message: "Don't use trailing whitespace"
searchPattern: "/ +$/gm"
replace: ""
searchScope: code
customRules:
# TODO: add markdownlint-rule-max-one-sentence-per-line/rule.js
- ./node_modules/markdownlint-rule-search-replace/rule.js
- ./node_modules/markdownlint-rule-titlecase/rule.js