-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy path.remarkrc.mjs
103 lines (93 loc) · 3.26 KB
/
.remarkrc.mjs
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
import { unified } from 'unified';
import unifiedMessageControl from 'unified-message-control';
import { commentMarker } from 'mdast-comment-marker';
import remarkFrontmatter from 'remark-frontmatter';
import remarkDirective from 'remark-directive';
import remarkGfm from 'remark-gfm';
// remark-preset-lint-recommended:
import remarkLint from 'remark-lint';
import remarkLintFinalNewline from 'remark-lint-final-newline';
import remarkLintListItemBulletIndent from 'remark-lint-list-item-bullet-indent';
// import remarkLintListItemIndent from 'remark-lint-list-item-indent' // Incompatible with MDX
import remarkLintNoBlockquoteWithoutMarker from 'remark-lint-no-blockquote-without-marker';
import remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls';
import remarkLintOrderedListMarkerStyle from 'remark-lint-ordered-list-marker-style';
import remarkLintHardBreakSpaces from 'remark-lint-hard-break-spaces';
import remarkLintNoDuplicateDefinitions from 'remark-lint-no-duplicate-definitions';
import remarkLintNoHeadingContentIndent from 'remark-lint-no-heading-content-indent';
import remarkLintNoInlinePadding from 'remark-lint-no-inline-padding';
import remarkLintNoShortcutReferenceImage from 'remark-lint-no-shortcut-reference-image';
import remarkLintNoShortcutReferenceLink from 'remark-lint-no-shortcut-reference-link';
import remarkLintNoUndefinedReferences from 'remark-lint-no-undefined-references';
import remarkLintNoUnusedDefinitions from 'remark-lint-no-unused-definitions';
import remarkPresetLintConsistent from 'remark-preset-lint-consistent';
import remarkRetext from 'remark-retext';
import retextEnglish from 'retext-english';
import retextEquality from 'retext-equality';
import retextProfanities from 'retext-profanities';
import retextQuotes from 'retext-quotes';
import retextSyntaxMentions from 'retext-syntax-mentions';
const retextPreset = [
remarkRetext,
unified()
.use(retextEnglish)
.use(retextEquality, {
ignore: [
'disabled',
'host',
'hosts',
'invalid',
'whitespace',
'of course',
'just',
'simple',
'simply',
'boys',
],
})
.use(retextProfanities, { sureness: 1, ignore: ['black', 'ball'] })
.use(retextQuotes)
.use(retextSyntaxMentions),
];
const messageControlPreset = [
unifiedMessageControl,
{
name: 'retext-simplify',
marker: commentMarker,
test: 'html',
},
];
export default {
settings: {
emphasis: '_',
strong: '*',
'tab-size': 1,
},
plugins: [
remarkFrontmatter, // YAML in MD
remarkGfm, // GitHub Flavored Markdown
remarkDirective, // Admonitions
remarkPresetLintConsistent,
// remark-preset-lint-recommended:
remarkLint,
// Unix compatibility.
remarkLintFinalNewline,
// Rendering across vendors differs greatly if using other styles.
remarkLintListItemBulletIndent,
// [remarkLintListItemIndent, 'tab-size'], // Incompatible with MDX
remarkLintNoBlockquoteWithoutMarker,
remarkLintNoLiteralUrls,
[remarkLintOrderedListMarkerStyle, '.'],
// Mistakes.
remarkLintHardBreakSpaces,
remarkLintNoDuplicateDefinitions,
remarkLintNoHeadingContentIndent,
remarkLintNoInlinePadding,
remarkLintNoShortcutReferenceImage,
remarkLintNoShortcutReferenceLink,
remarkLintNoUndefinedReferences,
remarkLintNoUnusedDefinitions,
retextPreset,
messageControlPreset,
],
};