/
index.js
138 lines (134 loc) · 6.34 KB
/
index.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/// <reference types="remark-stringify" />
/**
* @typedef {import('unified').Preset} Preset
*/
import remarkCommentConfig from 'remark-comment-config'
import remarkGfm from 'remark-gfm'
import remarkGithub from 'remark-github'
import remarkLintBlockquoteIndentation from 'remark-lint-blockquote-indentation'
import remarkLintCheckboxCharacterStyle from 'remark-lint-checkbox-character-style'
import remarkLintCheckboxContentIndent from 'remark-lint-checkbox-content-indent'
import remarkLintCodeBlockStyle from 'remark-lint-code-block-style'
import remarkLintDefinitionCase from 'remark-lint-definition-case'
import remarkLintDefinitionSpacing from 'remark-lint-definition-spacing'
import remarkLintEmphasisMarker from 'remark-lint-emphasis-marker'
import remarkLintFencedCodeFlag from 'remark-lint-fenced-code-flag'
import remarkLintFencedCodeMarker from 'remark-lint-fenced-code-marker'
import remarkLintFileExtension from 'remark-lint-file-extension'
import remarkLintFinalDefinition from 'remark-lint-final-definition'
import remarkLintFirstHeadingLevel from 'remark-lint-first-heading-level'
import remarkLintHeadingStyle from 'remark-lint-heading-style'
import remarkLintLinkTitleStyle from 'remark-lint-link-title-style'
import remarkLintMaximumHeadingLength from 'remark-lint-maximum-heading-length'
import remarkLintMaximumLineLength from 'remark-lint-maximum-line-length'
import remarkLintNoConsecutiveBlankLines from 'remark-lint-no-consecutive-blank-lines'
import remarkLintNoDuplicateDefinedUrls from 'remark-lint-no-duplicate-defined-urls'
import remarkLintNoDuplicateDefinitions from 'remark-lint-no-duplicate-definitions'
import remarkLintNoDuplicateHeadingsInSection from 'remark-lint-no-duplicate-headings-in-section'
import remarkLintNoEmphasisAsHeading from 'remark-lint-no-emphasis-as-heading'
import remarkLintNoEmptyUrl from 'remark-lint-no-empty-url'
import remarkLintNoFileNameArticles from 'remark-lint-no-file-name-articles'
import remarkLintNoFileNameConsecutiveDashes from 'remark-lint-no-file-name-consecutive-dashes'
import remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'
import remarkLintNoFileNameMixedCase from 'remark-lint-no-file-name-mixed-case'
import remarkLintNoFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes'
import remarkLintNoHeadingContentIndent from 'remark-lint-no-heading-content-indent'
import remarkLintNoHeadingIndent from 'remark-lint-no-heading-indent'
import remarkLintNoHeadingLikeParagraph from 'remark-lint-no-heading-like-paragraph'
import remarkLintNoHtml from 'remark-lint-no-html'
import remarkLintNoMissingBlankLines from 'remark-lint-no-missing-blank-lines'
import remarkLintNoMultipleToplevelHeadings from 'remark-lint-no-multiple-toplevel-headings'
import remarkLintNoParagraphContentIndent from 'remark-lint-no-paragraph-content-indent'
import remarkLintNoReferenceLikeUrl from 'remark-lint-no-reference-like-url'
import remarkLintNoShellDollars from 'remark-lint-no-shell-dollars'
import remarkLintNoTableIndentation from 'remark-lint-no-table-indentation'
import remarkLintNoTabs from 'remark-lint-no-tabs'
import remarkLintNoUnneededFullReferenceImage from 'remark-lint-no-unneeded-full-reference-image'
import remarkLintNoUnneededFullReferenceLink from 'remark-lint-no-unneeded-full-reference-link'
import remarkLintOrderedListMarkerValue from 'remark-lint-ordered-list-marker-value'
import remarkLintRuleStyle from 'remark-lint-rule-style'
import remarkLintStrongMarker from 'remark-lint-strong-marker'
import remarkLintTableCellPadding from 'remark-lint-table-cell-padding'
import remarkLintTablePipeAlignment from 'remark-lint-table-pipe-alignment'
import remarkLintTablePipes from 'remark-lint-table-pipes'
import remarkLintUnorderedListMarkerStyle from 'remark-lint-unordered-list-marker-style'
import remarkPresetLintRecommended from 'remark-preset-lint-recommended'
import remarkRetext from 'remark-retext'
import remarkToc from 'remark-toc'
import remarkValidateLinks from 'remark-validate-links'
import retextEnglish from 'retext-english'
import retextPresetWooorm from 'retext-preset-wooorm'
import {unified} from 'unified'
/** @type {Preset} */
const remarkPresetWooorm = {
settings: {
bullet: '*',
emphasis: '*',
fences: true,
ruleSpaces: false
},
plugins: [
[remarkRetext, unified().use(retextEnglish).use(retextPresetWooorm)],
remarkPresetLintRecommended,
remarkCommentConfig,
remarkValidateLinks,
[remarkLintBlockquoteIndentation, 2],
[remarkLintCheckboxCharacterStyle, {checked: 'x', unchecked: ' '}],
remarkLintCheckboxContentIndent,
[remarkLintCodeBlockStyle, 'fenced'],
remarkLintDefinitionCase,
remarkLintDefinitionSpacing,
[remarkLintEmphasisMarker, '*'],
remarkLintFencedCodeFlag,
[remarkLintFencedCodeMarker, '`'],
[remarkLintFileExtension, ['md', 'mdx']],
remarkLintFinalDefinition,
remarkLintFirstHeadingLevel,
[remarkLintHeadingStyle, 'atx'],
[remarkLintLinkTitleStyle, '"'],
[remarkLintMaximumHeadingLength, 60],
[remarkLintMaximumLineLength, 80],
remarkLintNoConsecutiveBlankLines,
remarkLintNoDuplicateDefinedUrls,
remarkLintNoDuplicateDefinitions,
remarkLintNoDuplicateHeadingsInSection,
remarkLintNoEmphasisAsHeading,
remarkLintNoEmptyUrl,
remarkLintNoFileNameArticles,
remarkLintNoFileNameConsecutiveDashes,
remarkLintNoFileNameIrregularCharacters,
remarkLintNoFileNameMixedCase,
remarkLintNoFileNameOuterDashes,
remarkLintNoHeadingContentIndent,
remarkLintNoHeadingIndent,
remarkLintNoHeadingLikeParagraph,
remarkLintNoHtml,
[remarkLintNoMissingBlankLines, {exceptTightLists: true}],
remarkLintNoMultipleToplevelHeadings,
remarkLintNoParagraphContentIndent,
remarkLintNoReferenceLikeUrl,
remarkLintNoShellDollars,
remarkLintNoTableIndentation,
remarkLintNoTabs,
remarkLintNoUnneededFullReferenceImage,
remarkLintNoUnneededFullReferenceLink,
[remarkLintOrderedListMarkerValue, 'ordered'],
[remarkLintRuleStyle, '***'],
[remarkLintStrongMarker, '*'],
[remarkLintTableCellPadding, 'padded'],
remarkLintTablePipeAlignment,
remarkLintTablePipes,
[remarkLintUnorderedListMarkerStyle, '*'],
[
remarkToc,
{
heading: 'contents|table[ -]of[ -]contents?|toc',
maxDepth: 3,
tight: true
}
],
remarkGfm,
remarkGithub
]
}
export default remarkPresetWooorm