-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.remarkrc.js
36 lines (32 loc) · 911 Bytes
/
.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
/**
* @import {CheckFlag} from 'remark-lint-fenced-code-flag'
* @import {Preset} from 'unified'
*/
import remarkPresetWooorm from 'remark-preset-wooorm'
import remarkLintFencedCodeFlag, {
checkGithubLinguistFlag
} from 'remark-lint-fenced-code-flag'
import remarkLintMaximumHeadingLength from 'remark-lint-maximum-heading-length'
/** @type {Preset} */
const remarkPresetMdx = {
plugins: [
remarkPresetWooorm,
[remarkLintFencedCodeFlag, check],
[remarkLintMaximumHeadingLength, false]
]
}
export default remarkPresetMdx
/**
* Check according to GitHub Linguist.
*
* @param {string} value
* Language flag to check.
* @returns {string | undefined}
* Whether the flag is valid (`undefined`),
* or a message to warn about (`string`).
* @satisfies {CheckFlag}
*/
function check(value) {
if (value === 'mdx-invalid') return undefined
return checkGithubLinguistFlag(value)
}