-
-
Notifications
You must be signed in to change notification settings - Fork 248
/
.remarkrc.js
85 lines (80 loc) · 2.37 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
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
import { unified } from "unified";
import dictionaryEn from "dictionary-en";
import fs from "fs";
import retextEnglish from "retext-english";
import retextEquality from "retext-equality";
import retextIndefiniteArticle from "retext-indefinite-article";
import retextPassive from "retext-passive";
import retextReadability from "retext-readability";
import retextRepeatedWords from "retext-repeated-words";
import retextSimplify from "retext-simplify";
import retextIntensify from "retext-intensify";
import retextProfanities from "retext-profanities";
import retextSpell from "retext-spell";
import retextRedundantAcronyms from "retext-redundant-acronyms";
import retextSentenceSpacing from "retext-sentence-spacing";
import retextStringify from "retext-stringify";
import remarkTextr from "remark-textr";
const personalDict = fs
.readFileSync("dictionary.txt", "utf8")
.replace(/#.+/gm, "");
const retextSettings = {
plugins: [
retextEnglish,
retextEquality,
retextIndefiniteArticle,
retextPassive,
retextReadability,
retextRepeatedWords,
retextSimplify,
[retextSpell, { dictionary: dictionaryEn, personal: personalDict }],
// retextContractions,
retextIntensify,
retextProfanities,
retextRedundantAcronyms,
retextSentenceSpacing,
retextStringify,
],
};
const textrSettings = {
options: {
locale: "en-us",
},
plugins: [
"typographic-arrows",
"typographic-copyright",
"typographic-em-dashes",
"typographic-en-dashes",
"typographic-math-symbols",
"typographic-registered-trademark",
"typographic-single-spaces",
"typographic-trademark",
],
};
const config = {
plugins: [
"remark-gfm",
"remark-preset-lint-recommended",
"remark-preset-lint-consistent",
"remark-preset-lint-markdown-style-guide",
["remark-lint-no-undefined-references", false], // FIX THIS
["remark-lint-maximum-line-length", false],
["remark-lint-unordered-list-marker-style", "*"],
["remark-lint-maximum-heading-length", false],
["remark-frontmatter", "yaml"],
[remarkTextr, textrSettings],
["remark-retext", unified().use(retextSettings)], // TODO: Use Stringify to auto fix
],
settings: {
rule: "-",
footnotes: true,
gfm: true,
fence: "`",
ruleSpaces: false,
ruleRepetition: 3,
yaml: true,
fences: true,
spacedTable: true,
},
};
export default config;