-
Notifications
You must be signed in to change notification settings - Fork 538
/
.markdownlint-cli2.cjs
38 lines (35 loc) · 1.34 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
const githubMarkdownOpinions = require('@github/markdownlint-github')
// Rules we want to turn on but currently have too many violations
const rulesToEnforce = {
'fenced-code-language': false,
// Fix https://github.com/primer/doctocat/issues/527, then set this rule to `siblings_only: true`
'no-duplicate-header': false,
// This currently conflicts with how prettier autoformats
'ul-style': false,
}
// Rules we don't care to enforce (usually stylistic)
const rulesToNotEnforce = {
'line-length': false,
'blanks-around-headings': false,
'blanks-around-lists': false,
'no-trailing-spaces': false,
'no-multiple-blanks': false,
'no-trailing-punctuation': false,
'single-trailing-newline': false,
'ul-indent': false,
'no-hard-tabs': false,
'first-line-heading': false,
'no-space-in-emphasis': false,
'blanks-around-fences': false,
}
const defaultOverrides = {
'no-generic-link-text': {exceptions: ['link']}, // We don't want it to flag links that link to `Link` component.
}
const options = githubMarkdownOpinions.init({...rulesToNotEnforce, ...rulesToEnforce, ...defaultOverrides})
module.exports = {
config: options,
customRules: ['@github/markdownlint-github'],
outputFormatters: [
['markdownlint-cli2-formatter-pretty', {appendLink: true}], // ensures the error message includes a link to the rule documentation
],
}