-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.remarkrc.mjs
109 lines (101 loc) · 2.84 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
104
105
106
107
108
109
// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------
import { readFileSync as fsReadFileSync } from 'node:fs';
import { unified } from 'unified';
import strip from 'strip-comments';
const infoStrings = [
'ada',
'bash',
'bibtex',
'c',
'coffee',
'console',
'cpp',
'csharp',
'css',
'diff',
'dir',
'dts',
'elixir',
'fortran',
'fountain',
'gitattributes',
'golang',
'html',
'html+jinja',
'html+liquid',
'java',
'js',
'json',
'markdown',
'matlab',
'objc',
'pascal',
'perl',
'php',
'powershell',
'python',
'r',
'ruby',
'rust',
'scheme',
'tex',
'text',
'typescript',
'yaml',
];
const projectTerms = strip(fsReadFileSync('./project-terms.txt', 'utf8'));
const naturalLanguage = unified().use([
[await import('retext-english'), {}],
[await import('retext-syntax-urls'), {}],
[await import('retext-passive'), {}],
[await import('retext-readability'), { age: 21, minWords: 8 }],
[await import('retext-repeated-words'), {}],
[
await import('retext-simplify'),
{ ignore: ['function', 'interface', 'maintain'] },
],
[await import('retext-sentence-spacing'), { preferred: 1 }],
[await import('retext-syntax-mentions'), {}],
[
await import('retext-spell'),
{ dictionary: await import('dictionary-en'), personal: projectTerms },
],
[await import('retext-syntax-urls')],
]);
export default {
plugins: [
await import('remark-lint'),
['remark-gfm'],
['remark-footnotes'],
['remark-frontmatter'],
[await import('remark-preset-lint-consistent'), {}],
// Leave this preset at the top so that it can be overridden.
[await import('remark-preset-lint-recommended'), {}],
[
await import('remark-lint-checkbox-character-style'),
{
checked: 'x',
unchecked: ' ',
},
],
[await import('remark-lint-checkbox-content-indent')],
// Remark Lint Style Guide preset and overrides.
[await import('remark-preset-lint-markdown-style-guide')],
['remark-lint-no-file-name-consecutive-dashes', true],
['remark-lint-fenced-code-flag', { flags: infoStrings }],
['remark-lint-no-heading-punctuation', ':.,;'],
['remark-lint-no-file-name-mixed-case', false],
['remark-lint-no-file-name-irregular-characters', false],
['remark-lint-first-heading-level', 2],
// Third-party plugins.
[await import('remark-validate-links'), {}],
[await import('remark-lint-maximum-line-length'), {}],
[await import('remark-lint-no-duplicate-headings-in-section'), {}],
[await import('remark-retext'), naturalLanguage],
// Disables all rules that conflict with Prettier. Leave this preset at the
// bottom so that it can't be overridden.
[await import('remark-preset-prettier'), {}],
],
};