@kitschpatrol/remark-config 3.1.0 → 4.1.0
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 +40 -34
- package/init/.remarkrc.js +3 -3
- package/init/.vscode/extensions.json +3 -0
- package/package.json +3 -2
- package/{main.js → remark.config.js} +60 -60
package/init/.remarkrc.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import sharedConfig, { overrideRules } from '@kitschpatrol/remark-config'
|
|
1
|
+
import sharedConfig, { overrideRules } from '@kitschpatrol/remark-config'
|
|
2
2
|
|
|
3
3
|
const localConfig = {
|
|
4
4
|
...sharedConfig,
|
|
5
5
|
// Overrides are a special case, working as below (set `false` as the second element to disable):
|
|
6
6
|
// plugins: overrideRules(sharedConfig.plugins, [['remark-lint-first-heading-level', 2]])
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
|
|
9
|
-
export default localConfig
|
|
9
|
+
export default localConfig
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/remark-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Linting for markdown and MDX files, managed via ESLint.",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"bin": {
|
|
26
26
|
"remark-config": "bin/cli.js"
|
|
27
27
|
},
|
|
28
|
-
"main": "
|
|
28
|
+
"main": "remark.config.js",
|
|
29
29
|
"files": [
|
|
30
30
|
"bin/*",
|
|
31
31
|
"init/*"
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@pinojs/json-colorizer": "^4.0.0",
|
|
35
35
|
"cosmiconfig": "^9.0.0",
|
|
36
36
|
"execa": "^8.0.1",
|
|
37
|
+
"fs-extra": "^11.2.0",
|
|
37
38
|
"remark-cli": "^12.0.0",
|
|
38
39
|
"remark-directive": "^3.0.0",
|
|
39
40
|
"remark-frontmatter": "^5.0.0",
|
|
@@ -1,52 +1,52 @@
|
|
|
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 remarkLintNoEmphasisAsHeading from 'remark-lint-no-emphasis-as-heading'
|
|
21
|
-
import remarkLintNoEmptyUrl from 'remark-lint-no-empty-url'
|
|
22
|
-
import remarkLintNoFileNameArticles from 'remark-lint-no-file-name-articles'
|
|
23
|
-
import remarkLintNoFileNameConsecutiveDashes from 'remark-lint-no-file-name-consecutive-dashes'
|
|
24
|
-
import remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'
|
|
25
|
-
import remarkLintNoFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes'
|
|
26
|
-
import remarkLintNoHeadingIndent from 'remark-lint-no-heading-indent'
|
|
27
|
-
import remarkLintNoHeadingLikeParagraph from 'remark-lint-no-heading-like-paragraph'
|
|
28
|
-
import remarkLintNoHtml from 'remark-lint-no-html'
|
|
29
|
-
import remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls'
|
|
30
|
-
import remarkLintNoMissingBlankLines from 'remark-lint-no-missing-blank-lines'
|
|
31
|
-
import remarkLintNoMultipleToplevelHeadings from 'remark-lint-no-multiple-toplevel-headings'
|
|
32
|
-
import remarkLintNoParagraphContentIndent from 'remark-lint-no-paragraph-content-indent'
|
|
33
|
-
import remarkLintNoReferenceLikeUrl from 'remark-lint-no-reference-like-url'
|
|
34
|
-
import remarkLintNoShellDollars from 'remark-lint-no-shell-dollars'
|
|
35
|
-
import remarkLintNoShortcutReferenceImage from 'remark-lint-no-shortcut-reference-image'
|
|
36
|
-
import remarkLintNoShortcutReferenceLink from 'remark-lint-no-shortcut-reference-link'
|
|
37
|
-
import remarkLintNoTabs from 'remark-lint-no-tabs'
|
|
38
|
-
import remarkLintNoUndefinedReferences from 'remark-lint-no-undefined-references'
|
|
39
|
-
import remarkLintNoUnneededFullReferenceImage from 'remark-lint-no-unneeded-full-reference-image'
|
|
40
|
-
import remarkLintNoUnneededFullReferenceLink from 'remark-lint-no-unneeded-full-reference-link'
|
|
41
|
-
import remarkLintNoUnusedDefinitions from 'remark-lint-no-unused-definitions'
|
|
42
|
-
import remarkLintOrderedListMarkerStyle from 'remark-lint-ordered-list-marker-style'
|
|
43
|
-
import remarkLintRuleStyle from 'remark-lint-rule-style'
|
|
44
|
-
import remarkLintStrikethroughMarker from 'remark-lint-strikethrough-marker'
|
|
45
|
-
import remarkLintStrongMarker from 'remark-lint-strong-marker'
|
|
46
|
-
import remarkLintTableCellPadding from 'remark-lint-table-cell-padding'
|
|
47
|
-
import remarkLintUnorderedListMarkerStyle from 'remark-lint-unordered-list-marker-style'
|
|
48
|
-
import remarkPresetPrettier from 'remark-preset-prettier'
|
|
49
|
-
import remarkValidateLinks from 'remark-validate-links'
|
|
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 remarkLintNoEmphasisAsHeading from 'remark-lint-no-emphasis-as-heading'
|
|
21
|
+
import remarkLintNoEmptyUrl from 'remark-lint-no-empty-url'
|
|
22
|
+
import remarkLintNoFileNameArticles from 'remark-lint-no-file-name-articles'
|
|
23
|
+
import remarkLintNoFileNameConsecutiveDashes from 'remark-lint-no-file-name-consecutive-dashes'
|
|
24
|
+
import remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'
|
|
25
|
+
import remarkLintNoFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes'
|
|
26
|
+
import remarkLintNoHeadingIndent from 'remark-lint-no-heading-indent'
|
|
27
|
+
import remarkLintNoHeadingLikeParagraph from 'remark-lint-no-heading-like-paragraph'
|
|
28
|
+
import remarkLintNoHtml from 'remark-lint-no-html'
|
|
29
|
+
import remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls'
|
|
30
|
+
import remarkLintNoMissingBlankLines from 'remark-lint-no-missing-blank-lines'
|
|
31
|
+
import remarkLintNoMultipleToplevelHeadings from 'remark-lint-no-multiple-toplevel-headings'
|
|
32
|
+
import remarkLintNoParagraphContentIndent from 'remark-lint-no-paragraph-content-indent'
|
|
33
|
+
import remarkLintNoReferenceLikeUrl from 'remark-lint-no-reference-like-url'
|
|
34
|
+
import remarkLintNoShellDollars from 'remark-lint-no-shell-dollars'
|
|
35
|
+
import remarkLintNoShortcutReferenceImage from 'remark-lint-no-shortcut-reference-image'
|
|
36
|
+
import remarkLintNoShortcutReferenceLink from 'remark-lint-no-shortcut-reference-link'
|
|
37
|
+
import remarkLintNoTabs from 'remark-lint-no-tabs'
|
|
38
|
+
import remarkLintNoUndefinedReferences from 'remark-lint-no-undefined-references'
|
|
39
|
+
import remarkLintNoUnneededFullReferenceImage from 'remark-lint-no-unneeded-full-reference-image'
|
|
40
|
+
import remarkLintNoUnneededFullReferenceLink from 'remark-lint-no-unneeded-full-reference-link'
|
|
41
|
+
import remarkLintNoUnusedDefinitions from 'remark-lint-no-unused-definitions'
|
|
42
|
+
import remarkLintOrderedListMarkerStyle from 'remark-lint-ordered-list-marker-style'
|
|
43
|
+
import remarkLintRuleStyle from 'remark-lint-rule-style'
|
|
44
|
+
import remarkLintStrikethroughMarker from 'remark-lint-strikethrough-marker'
|
|
45
|
+
import remarkLintStrongMarker from 'remark-lint-strong-marker'
|
|
46
|
+
import remarkLintTableCellPadding from 'remark-lint-table-cell-padding'
|
|
47
|
+
import remarkLintUnorderedListMarkerStyle from 'remark-lint-unordered-list-marker-style'
|
|
48
|
+
import remarkPresetPrettier from 'remark-preset-prettier'
|
|
49
|
+
import remarkValidateLinks from 'remark-validate-links'
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Overrides specific rules in a set of plugins.
|
|
@@ -64,29 +64,29 @@ import remarkValidateLinks from 'remark-validate-links';
|
|
|
64
64
|
export function overrideRules(plugins, rules) {
|
|
65
65
|
for (let [ruleName, newArguments] of rules) {
|
|
66
66
|
// Internally, function names are different from the package names
|
|
67
|
-
ruleName = ruleName.replace(/^remark-lint-/, 'remark-lint:')
|
|
67
|
+
ruleName = ruleName.replace(/^remark-lint-/, 'remark-lint:')
|
|
68
68
|
|
|
69
|
-
let ruleFunction
|
|
69
|
+
let ruleFunction
|
|
70
70
|
const index = plugins.findIndex((plugin) => {
|
|
71
71
|
if (Array.isArray(plugin)) {
|
|
72
72
|
if (plugin[0]?.name === ruleName) {
|
|
73
|
-
ruleFunction = plugin[0]
|
|
74
|
-
return true
|
|
73
|
+
ruleFunction = plugin[0]
|
|
74
|
+
return true
|
|
75
75
|
}
|
|
76
76
|
} else if (plugin.name === ruleName) {
|
|
77
|
-
ruleFunction = plugin
|
|
78
|
-
return true
|
|
77
|
+
ruleFunction = plugin
|
|
78
|
+
return true
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
return false
|
|
82
|
-
})
|
|
81
|
+
return false
|
|
82
|
+
})
|
|
83
83
|
|
|
84
84
|
if (index !== -1) {
|
|
85
|
-
plugins.splice(index, 1, [ruleFunction, newArguments])
|
|
85
|
+
plugins.splice(index, 1, [ruleFunction, newArguments])
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
return plugins
|
|
89
|
+
return plugins
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
export default {
|
|
@@ -158,4 +158,4 @@ export default {
|
|
|
158
158
|
// strong: '*',
|
|
159
159
|
// tightDefinitions: true,
|
|
160
160
|
},
|
|
161
|
-
}
|
|
161
|
+
}
|