Update @types/mdast
, unified
, utilities
This commit is contained in:
parent
c223cd8e31
commit
a952370494
3 changed files with 13 additions and 16 deletions
15
index.js
15
index.js
|
@ -1,11 +1,14 @@
|
|||
/// <reference types="remark-parse" />
|
||||
/// <reference types="remark-stringify" />
|
||||
|
||||
/**
|
||||
* @typedef {import('mdast').Root} Root
|
||||
* @typedef {import('mdast-util-directive')} DoNotTouchAsThisImportIncludesDirectivesInTree
|
||||
* @typedef {import('unified').Processor<Root>} Processor
|
||||
*/
|
||||
|
||||
import {directive} from 'micromark-extension-directive'
|
||||
import {directiveFromMarkdown, directiveToMarkdown} from 'mdast-util-directive'
|
||||
import {directive} from 'micromark-extension-directive'
|
||||
|
||||
/**
|
||||
* Add support for generic directives.
|
||||
|
@ -23,20 +26,14 @@ export default function remarkDirective() {
|
|||
const self = /** @type {Processor} */ (this)
|
||||
const data = self.data()
|
||||
|
||||
/** @type {Array<unknown>} */
|
||||
// @ts-expect-error: to do: remove.
|
||||
const micromarkExtensions =
|
||||
data.micromarkExtensions || (data.micromarkExtensions = [])
|
||||
/** @type {Array<unknown>} */
|
||||
// @ts-expect-error: to do: remove.
|
||||
const fromMarkdownExtensions =
|
||||
data.fromMarkdownExtensions || (data.fromMarkdownExtensions = [])
|
||||
/** @type {Array<unknown>} */
|
||||
// @ts-expect-error: to do: remove.
|
||||
const toMarkdownExtensions =
|
||||
data.toMarkdownExtensions || (data.toMarkdownExtensions = [])
|
||||
|
||||
micromarkExtensions.push(directive())
|
||||
fromMarkdownExtensions.push(directiveFromMarkdown)
|
||||
toMarkdownExtensions.push(directiveToMarkdown)
|
||||
fromMarkdownExtensions.push(directiveFromMarkdown())
|
||||
toMarkdownExtensions.push(directiveToMarkdown())
|
||||
}
|
||||
|
|
12
package.json
12
package.json
|
@ -33,20 +33,20 @@
|
|||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@types/mdast": "^3.0.0",
|
||||
"mdast-util-directive": "^2.0.0",
|
||||
"micromark-extension-directive": "^2.0.0",
|
||||
"unified": "^10.0.0"
|
||||
"@types/mdast": "^4.0.0",
|
||||
"mdast-util-directive": "^3.0.0",
|
||||
"micromark-extension-directive": "^3.0.0",
|
||||
"unified": "^11.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.0.0",
|
||||
"c8": "^8.0.0",
|
||||
"is-hidden": "^2.0.0",
|
||||
"prettier": "^3.0.0",
|
||||
"remark": "^14.0.0",
|
||||
"remark": "^15.0.0",
|
||||
"remark-cli": "^11.0.0",
|
||||
"remark-preset-wooorm": "^9.0.0",
|
||||
"to-vfile": "^7.0.0",
|
||||
"to-vfile": "^8.0.0",
|
||||
"type-coverage": "^2.0.0",
|
||||
"typescript": "^5.0.0",
|
||||
"xo": "^0.56.0"
|
||||
|
|
Loading…
Add table
Reference in a new issue