-
Notifications
You must be signed in to change notification settings - Fork 100
/
.markdownlint-cli2.cjs
164 lines (159 loc) · 3.98 KB
/
.markdownlint-cli2.cjs
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
// @ts-check
module.exports = {
// Disable some built-in rules
config: {
// 定义文档中涉及的专有名词
MD044: {
code_blocks: false,
html_elements: false,
names: [
"Zotero",
"JavaScript",
"GitHub",
"WebDAV",
"Android",
"iOS",
"macOS",
"WPS",
"Word",
"ZotFile",
"Zotero Chinese",
],
},
"search-replace": {
rules: [
{
name: "直角引号",
message: "请使用直角引号「」而不是弯引号",
searchPattern: `/\s*“([^“”]+?)”\s*/g`,
replace: "「$1」",
searchScope: "text",
},
{
name: "中括号",
message: "不使用中括号【】",
searchPattern: `/\s*【([^【】]+?)】\s*/g`,
replace: "「$1」",
searchScope: "text",
},
{
name: "->",
message: "请使用 '->' 作为步骤连接符号,两边空一格",
searchPattern: `/=>|=》|-》/g`,
replace: "->",
searchScope: "text",
},
{
name: "界面元素",
message: "请使用直角引号包裹界面元素",
searchPattern: "/`([^`]*)` ?->/g",
replace: "「$1」->",
searchScope: "text",
},
{
name: "界面元素",
message: "请使用直角引号包裹界面元素",
searchPattern: "/-> ?`([^`]*)`/g",
replace: "->「$1」",
searchScope: "text",
},
// {
// name: "链接空格",
// message: "链接周围应有空格",
// searchPattern: `/(\S)(\[.*\]\(.*\))(\S)/g`,
// replace: "$1 $2 $3",
// searchScope: "text",
// },
],
},
// 兼容 Prettier
// @see https://github.com/DavidAnson/markdownlint/blob/main/doc/Prettier.md
"blanks-around-fences": false,
"blanks-around-headings": false,
"blanks-around-lists": false,
"code-fence-style": false,
"emphasis-style": false,
"heading-start-left": false,
"hr-style": false,
"line-length": false,
"list-indent": false,
"list-marker-space": false,
"no-blanks-blockquote": false,
"no-hard-tabs": false,
"no-missing-space-atx": false,
"no-missing-space-closed-atx": false,
"no-multiple-blanks": false,
"no-multiple-space-atx": false,
"no-multiple-space-blockquote": false,
"no-multiple-space-closed-atx": false,
"no-trailing-spaces": false,
"ol-prefix": false,
"strong-style": false,
"ul-indent": false,
// 其他规则配置
// @see https://github.com/vuepress-theme-hope/vuepress-theme-hope/blob/main/.markdownlint.json
default: true,
MD003: {
style: "atx",
},
MD004: {
style: "dash",
},
MD013: false,
MD024: {
siblings_only: true,
},
MD025: {
front_matter_title: "",
},
MD033: {
allowed_elements: [
"br",
"template",
"script",
"style",
"ArtPlayer",
"AudioPlayer",
"AutoCatalog",
"Badge",
"BiliBili",
"Catalog",
"CodePen",
"DemoProject",
"FontIcon",
"ProjectLink",
"PDF",
"Replit",
"Share",
"SiteInfo",
"StackBlitz",
"XiGua",
"VideoPlayer",
"YouTube",
"AppearanceSwitch",
"HopeIcon",
"FlowChartPlayground",
"IconDisplay",
"KatexPlayground",
"NetlifyBadge",
"PrintButton",
"ThemeColorPicker",
"ToggleFullScreenButton",
"ToggleRTLButton",
"sub",
"sup",
],
},
// 兼容 Prettier 禁用
// "MD035": {
// "style": "---"
// },
MD036: false,
MD040: false,
MD046: false,
MD049: false,
},
customRules: ["markdownlint-rule-search-replace"],
// Ignore files referenced by .gitignore (only valid at root)
gitignore: true,
};