-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
238 lines (237 loc) · 6.4 KB
/
index.js
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
"use strict";
module.exports = {
plugins: [
// Need for linting
require("remark-lint"),
// Warn when code blocks do not adhere to a given style.
// Warn for h7+ “headings”.
//
// ```md
// alpha();
//
// Paragraph.
//
// bravo();
// ```
[require("remark-lint-code-block-style"), "fenced"],
// Check fenced code block flags.
//
// ```md
//
// ```
// alpha();
// ```
//
// ```
require("remark-lint-fenced-code-flag"),
// Prefer `md` extension
[require("remark-lint-file-extension"), "md"],
// Warn when definitions are placed somewhere other than at the end of the file.
//
// ```md
// Paragraph.
//
// [example]: http://example.com "Example Domain"
//
// Another paragraph.
// ```
require("remark-lint-final-definition"),
// Warn when the first heading has a level other than a specified value.
//
// ```md
// ## Bravo
//
// Paragraph.
// ```
require("remark-lint-first-heading-level"),
// Warn when headings increment with more than 1 level at a time.
//
// ```md
// # Charlie
//
// ### Delta
// ```
require("remark-lint-heading-increment"),
// Warn for autolinks without protocol. Autolinks are URLs enclosed in `<` (less than) and `>` (greater than) characters.
// From `remark-preset-lint-recommended`
//
// ```md
// <foo@bar.com>
// ```
require("remark-lint-no-auto-link-without-protocol"),
// Warn when blank lines without `>` (greater than) markers are found in a block quote.
//
// ```md
// > Foo…
// …bar…
// > …baz.
// ```
require("remark-lint-no-blockquote-without-marker"),
// Warn when duplicate definitions are found.
// From `remark-preset-lint-recommended`
//
// ```md
// [foo]: bar
// [foo]: qux
// ```
require("remark-lint-no-duplicate-definitions"),
// Warn when duplicate headings are found, but only when on the same level, “in” the same section.
//
// ```md
// ## Foxtrot
//
// ### Golf
//
// ### Golf
// ```
require("remark-lint-no-duplicate-headings-in-section"),
// Warn for empty URLs in links and images.
//
// ```md
// [golf]().
//
// ![hotel]().
// ```
require("remark-lint-no-empty-url"),
// Warn when file names contain consecutive dashes.
// Bad: `plug--ins.md`
require("remark-lint-no-file-name-consecutive-dashes"),
// Warn when file names contain irregular characters: characters other than alphanumericals (a-zA-Z0-9), hyphen-minus (-), dots (., full stops) and `_`.
[
require("remark-lint-no-file-name-irregular-characters"),
"\\\\.a-zA-Z0-9-_",
],
// Warn when file names use mixed case: both upper- and lowercase characters.
// Bad: `Readme.md`
require("remark-lint-no-file-name-mixed-case"),
// Warn when file names contain initial or final dashes (hyphen-minus, -).
// Bad: `-readme.md` and `readme-.md`
require("remark-lint-no-file-name-outer-dashes"),
// Warn for h7+ “headings”.
//
// ```md
// ####### Charlie
// ```
require("remark-lint-no-heading-like-paragraph"),
// Warn when a heading ends with a group of characters.
//
// ```md
// # Hello.
//
// # Hello,
//
// # Hello;
//
// # Hello:
// ```
[require("remark-lint-no-heading-punctuation"), ".,;:"],
// Warn when HTML nodes are used.
//
// ```md
// <h1>Hello</h1>
// ```
require("remark-lint-no-html"),
// Warn when phrasing content is padded with spaces between their markers and content.
// From `remark-preset-lint-recommended`
//
// ```md
// Alpha [ bravo ](http://echo.fox/trot)
// ```
require("remark-lint-no-inline-padding"),
// Warn for literal URLs in text. URLs are treated as links in some Markdown vendors, but not in others. To make sure they are always linked, wrap them in `<` (less than) and `>` (greater than).
// From `remark-preset-lint-recommended`
require("remark-lint-no-literal-urls"),
// Do not use multiple top level headings
//
// ```md
// # Foo
//
// # Bar
// ```
require("remark-lint-no-multiple-toplevel-headings"),
// Warn when URLs are also defined identifiers.
//
// ```md
// [Charlie](delta).
//
// [delta]: https://example.com
// ```
require("remark-lint-no-reference-like-url"),
// Warn when shell code is prefixed by `$` (dollar sign) characters.
//
// ```md
// ```sh
// $ echo a
// ```
//
// ```bash
// $ echo a
// $ echo a > file
// ```
// ```
require("remark-lint-no-shell-dollars"),
// Warn when shortcut reference images are used.
// Shortcut references render as images when a definition is found, and as plain text without definition.
// Sometimes, you don’t intend to create an image from the reference, but this rule still warns anyway.
// In that case, you can escape the reference like so: !\[foo].
// From `remark-preset-lint-recommended`
//
// ```md
// ![foo]
//
// [foo]: http://foo.bar/baz.png
// ```
require("remark-lint-no-shortcut-reference-image"),
// Warn when shortcut reference links are used.
// From `remark-preset-lint-recommended`.
//
// ```md
// [foo]
//
// [foo]: http://foo.bar/baz
// ```
require("remark-lint-no-shortcut-reference-link"),
// Warn when references to undefined definitions are found.
// From `remark-preset-lint-recommended`.
//
// ```md
// [bar]
//
// [baz][]
//
// [text][qux]
//
// Spread [over
// lines][]
//
// > in [a
// > block quote][]
//
// [asd][a
//
// Can include [*emphasis*].
//
// Multiple pairs: [a][b][c].
// ```
require("remark-lint-no-undefined-references"),
// Warn when unused definitions are found.
// From `remark-preset-lint-recommended`.
//
// ```md
// 1. Foo
// 1. Bar
// 1. Bar
// ```
require("remark-lint-no-unused-definitions"),
// Warn when the list item marker values of ordered lists violate a given style.
//
// ```md
// 1. Foo
// 1. Bar
// 1. Bar
// ```
[require("remark-lint-ordered-list-marker-value"), "ordered"],
// Validate links.
require("remark-validate-links"),
],
};