@kitschpatrol/remark-config 4.7.12 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +6262 -58
- package/dist/index.d.ts +23 -0
- package/dist/index.js +260 -0
- package/init/.remarkrc.js +2 -11
- package/license.txt +1 -1
- package/package.json +67 -64
- package/readme.md +65 -17
- package/remark.config.js +0 -155
package/remark.config.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import remarkDirective from 'remark-directive'
|
|
2
|
-
import remarkFrontmatter from 'remark-frontmatter'
|
|
3
|
-
import remarkGfm from 'remark-gfm'
|
|
4
|
-
import remarkLint from 'remark-lint'
|
|
5
|
-
import remarkLintCheckboxCharacterStyle from 'remark-lint-checkbox-character-style'
|
|
6
|
-
import remarkLintCheckboxContentIndent from 'remark-lint-checkbox-content-indent'
|
|
7
|
-
import remarkLintCodeBlockStyle from 'remark-lint-code-block-style'
|
|
8
|
-
import remarkLintEmphasisMarker from 'remark-lint-emphasis-marker'
|
|
9
|
-
import remarkLintFencedCodeFlag from 'remark-lint-fenced-code-flag'
|
|
10
|
-
import remarkLintFencedCodeMarker from 'remark-lint-fenced-code-marker'
|
|
11
|
-
import remarkLintFinalDefinition from 'remark-lint-final-definition'
|
|
12
|
-
import remarkLintFirstHeadingLevel from 'remark-lint-first-heading-level'
|
|
13
|
-
import remarkLintHeadingIncrement from 'remark-lint-heading-increment'
|
|
14
|
-
import remarkLintLinebreakStyle from 'remark-lint-linebreak-style'
|
|
15
|
-
import remarkLintMaximumHeadingLength from 'remark-lint-maximum-heading-length'
|
|
16
|
-
import remarkLintNoDuplicateDefinedUrls from 'remark-lint-no-duplicate-defined-urls'
|
|
17
|
-
import remarkLintNoDuplicateDefinitions from 'remark-lint-no-duplicate-definitions'
|
|
18
|
-
import remarkLintNoDuplicateHeadings from 'remark-lint-no-duplicate-headings'
|
|
19
|
-
import remarkLintNoDuplicateHeadingsInSection from 'remark-lint-no-duplicate-headings-in-section'
|
|
20
|
-
import remarkLintNoEmptyUrl from 'remark-lint-no-empty-url'
|
|
21
|
-
import remarkLintNoFileNameArticles from 'remark-lint-no-file-name-articles'
|
|
22
|
-
import remarkLintNoFileNameConsecutiveDashes from 'remark-lint-no-file-name-consecutive-dashes'
|
|
23
|
-
import remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'
|
|
24
|
-
import remarkLintNoFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes'
|
|
25
|
-
import remarkLintNoHeadingIndent from 'remark-lint-no-heading-indent'
|
|
26
|
-
import remarkLintNoHeadingLikeParagraph from 'remark-lint-no-heading-like-paragraph'
|
|
27
|
-
import remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls'
|
|
28
|
-
import remarkLintNoMultipleToplevelHeadings from 'remark-lint-no-multiple-toplevel-headings'
|
|
29
|
-
import remarkLintNoParagraphContentIndent from 'remark-lint-no-paragraph-content-indent'
|
|
30
|
-
import remarkLintNoReferenceLikeUrl from 'remark-lint-no-reference-like-url'
|
|
31
|
-
import remarkLintNoShellDollars from 'remark-lint-no-shell-dollars'
|
|
32
|
-
import remarkLintNoShortcutReferenceImage from 'remark-lint-no-shortcut-reference-image'
|
|
33
|
-
import remarkLintNoShortcutReferenceLink from 'remark-lint-no-shortcut-reference-link'
|
|
34
|
-
import remarkLintNoTabs from 'remark-lint-no-tabs'
|
|
35
|
-
import remarkLintNoUndefinedReferences from 'remark-lint-no-undefined-references'
|
|
36
|
-
import remarkLintNoUnneededFullReferenceImage from 'remark-lint-no-unneeded-full-reference-image'
|
|
37
|
-
import remarkLintNoUnneededFullReferenceLink from 'remark-lint-no-unneeded-full-reference-link'
|
|
38
|
-
import remarkLintNoUnusedDefinitions from 'remark-lint-no-unused-definitions'
|
|
39
|
-
import remarkLintOrderedListMarkerStyle from 'remark-lint-ordered-list-marker-style'
|
|
40
|
-
import remarkLintRuleStyle from 'remark-lint-rule-style'
|
|
41
|
-
import remarkLintStrikethroughMarker from 'remark-lint-strikethrough-marker'
|
|
42
|
-
import remarkLintStrongMarker from 'remark-lint-strong-marker'
|
|
43
|
-
import remarkLintTableCellPadding from 'remark-lint-table-cell-padding'
|
|
44
|
-
import remarkLintUnorderedListMarkerStyle from 'remark-lint-unordered-list-marker-style'
|
|
45
|
-
import remarkPresetPrettier from 'remark-preset-prettier'
|
|
46
|
-
import remarkValidateLinks from 'remark-validate-links'
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Overrides specific rules in a set of plugins.
|
|
50
|
-
*
|
|
51
|
-
* This function searches through an array of plugins to find and override
|
|
52
|
-
* multiple plugins by their names, replacing their arguments with new ones.
|
|
53
|
-
*
|
|
54
|
-
* See this link for why we need this:
|
|
55
|
-
* https://github.com/remarkjs/remark-lint/issues/165
|
|
56
|
-
*
|
|
57
|
-
* @param {any[]} plugins - An array of plugins, where each plugin is either a function or an array containing a function and its arguments.
|
|
58
|
-
* @param {Array.<[string, any]>} rules - An array of [ruleName, newArgs] pairs, where `ruleName` is the name of the rule to override and `newArgs` are the new arguments to apply.
|
|
59
|
-
* @returns {any[]} The modified array of plugins with the overridden rules.
|
|
60
|
-
*/
|
|
61
|
-
export function overrideRules(plugins, rules) {
|
|
62
|
-
for (let [ruleName, newArguments] of rules) {
|
|
63
|
-
// Internally, function names are different from the package names
|
|
64
|
-
ruleName = ruleName.replace(/^remark-lint-/, 'remark-lint:')
|
|
65
|
-
|
|
66
|
-
let ruleFunction
|
|
67
|
-
const index = plugins.findIndex((plugin) => {
|
|
68
|
-
if (Array.isArray(plugin)) {
|
|
69
|
-
if (plugin[0]?.name === ruleName) {
|
|
70
|
-
ruleFunction = plugin[0]
|
|
71
|
-
return true
|
|
72
|
-
}
|
|
73
|
-
} else if (plugin.name === ruleName) {
|
|
74
|
-
ruleFunction = plugin
|
|
75
|
-
return true
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return false
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
if (index !== -1) {
|
|
82
|
-
plugins.splice(index, 1, [ruleFunction, newArguments])
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return plugins
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export default {
|
|
90
|
-
plugins: [
|
|
91
|
-
remarkLint,
|
|
92
|
-
remarkFrontmatter,
|
|
93
|
-
remarkGfm,
|
|
94
|
-
remarkDirective,
|
|
95
|
-
[remarkLintCheckboxCharacterStyle, 'x'],
|
|
96
|
-
remarkLintCheckboxContentIndent,
|
|
97
|
-
[remarkLintCodeBlockStyle, 'fenced'],
|
|
98
|
-
[remarkLintEmphasisMarker, '*'],
|
|
99
|
-
[remarkLintFencedCodeFlag, { allowEmpty: false }],
|
|
100
|
-
[remarkLintFencedCodeMarker, '`'],
|
|
101
|
-
// Crashes with "Cannot use 'in' operator to search for 'start' in undefined"
|
|
102
|
-
// [remarkLintFileExtension, 'md'],
|
|
103
|
-
remarkLintFinalDefinition,
|
|
104
|
-
remarkLintFirstHeadingLevel,
|
|
105
|
-
remarkLintHeadingIncrement,
|
|
106
|
-
// [remarkLintHeadingStyle, 'atx'], Prettier
|
|
107
|
-
remarkLintLinebreakStyle,
|
|
108
|
-
remarkLintMaximumHeadingLength,
|
|
109
|
-
// RemarkLintNoAutoLinkWithoutProtocol, // Deprecated
|
|
110
|
-
remarkLintNoDuplicateDefinedUrls,
|
|
111
|
-
remarkLintNoDuplicateDefinitions,
|
|
112
|
-
remarkLintNoDuplicateHeadings,
|
|
113
|
-
remarkLintNoDuplicateHeadingsInSection,
|
|
114
|
-
remarkLintNoEmptyUrl,
|
|
115
|
-
remarkLintNoFileNameArticles,
|
|
116
|
-
remarkLintNoFileNameConsecutiveDashes,
|
|
117
|
-
remarkLintNoFileNameIrregularCharacters,
|
|
118
|
-
// Crashes with "Cannot use 'in' operator to search for 'start' in undefined"
|
|
119
|
-
// RemarkLintNoFileNameMixedCase,
|
|
120
|
-
remarkLintNoFileNameOuterDashes,
|
|
121
|
-
remarkLintNoHeadingIndent,
|
|
122
|
-
remarkLintNoHeadingLikeParagraph,
|
|
123
|
-
remarkLintNoLiteralUrls,
|
|
124
|
-
remarkLintNoMultipleToplevelHeadings,
|
|
125
|
-
remarkLintNoParagraphContentIndent,
|
|
126
|
-
remarkLintNoReferenceLikeUrl,
|
|
127
|
-
remarkLintNoShellDollars,
|
|
128
|
-
remarkLintNoShortcutReferenceImage,
|
|
129
|
-
remarkLintNoShortcutReferenceLink,
|
|
130
|
-
remarkLintNoTabs,
|
|
131
|
-
remarkLintNoUndefinedReferences,
|
|
132
|
-
remarkLintNoUnneededFullReferenceImage,
|
|
133
|
-
remarkLintNoUnneededFullReferenceLink,
|
|
134
|
-
remarkLintNoUnusedDefinitions,
|
|
135
|
-
remarkLintNoUnusedDefinitions,
|
|
136
|
-
[remarkLintOrderedListMarkerStyle, '.'],
|
|
137
|
-
[remarkLintRuleStyle, '---'],
|
|
138
|
-
remarkLintStrikethroughMarker,
|
|
139
|
-
[remarkLintStrongMarker, '*'],
|
|
140
|
-
[remarkLintTableCellPadding, 'padded'],
|
|
141
|
-
[remarkLintUnorderedListMarkerStyle, '-'],
|
|
142
|
-
remarkValidateLinks,
|
|
143
|
-
remarkPresetPrettier,
|
|
144
|
-
],
|
|
145
|
-
settings: {
|
|
146
|
-
bullet: '-',
|
|
147
|
-
// 1stg settings
|
|
148
|
-
// emphasis: '_',
|
|
149
|
-
// listItemIndent: 'one',
|
|
150
|
-
// quote: "'",
|
|
151
|
-
// rule: '-',
|
|
152
|
-
// strong: '*',
|
|
153
|
-
// tightDefinitions: true,
|
|
154
|
-
},
|
|
155
|
-
}
|