-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
.remarkrc.js
56 lines (53 loc) · 1.84 KB
/
.remarkrc.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
import fs from 'node:fs/promises'
import dictionaryEn from 'dictionary-en'
import remarkFrontmatter from 'remark-frontmatter'
import remarkLintFirstHeadingLevel from 'remark-lint-first-heading-level'
import remarkLintNoDeadUrls from 'remark-lint-no-dead-urls'
import remarkLintNoHtml from 'remark-lint-no-html'
import remarkPresetWooorm from 'remark-preset-wooorm'
import remarkRetext from 'remark-retext'
import remarkValidateLinks from 'remark-validate-links'
import retextEmoji from 'retext-emoji'
import retextEnglish from 'retext-english'
import retextEquality from 'retext-equality'
import retextPassive from 'retext-passive'
import retextPresetWooorm from 'retext-preset-wooorm'
import retextProfanities from 'retext-profanities'
import retextReadability from 'retext-readability'
import retextSimplify from 'retext-simplify'
import retextSpell from 'retext-spell'
import retextSyntaxMentions from 'retext-syntax-mentions'
import retextSyntaxUrls from 'retext-syntax-urls'
import stripComments from 'strip-comments'
import {unified} from 'unified'
const naturalLanguage = unified().use([
retextEnglish,
retextPresetWooorm,
[retextEquality, {ignore: ['hosts', 'whitespace']}],
[retextPassive, {ignore: ['hidden']}],
[retextProfanities, {sureness: 1}],
[retextReadability, {age: 18, minWords: 8}],
[retextSimplify, {ignore: ['function', 'interface', 'maintain', 'type']}],
retextEmoji,
retextSyntaxMentions,
retextSyntaxUrls,
[
retextSpell,
{
dictionary: dictionaryEn,
personal: stripComments(await fs.readFile('dictionary.txt', 'utf8'))
}
]
])
const config = {
plugins: [
remarkPresetWooorm,
remarkFrontmatter,
[remarkRetext, naturalLanguage],
remarkValidateLinks,
[remarkLintNoDeadUrls, 'https://unifiedjs.com'],
[remarkLintFirstHeadingLevel, 2],
[remarkLintNoHtml, false]
]
}
export default config