Skip to content

Commit

Permalink
remark-stringify: fix types to disallow options.extensions
Browse files Browse the repository at this point in the history
Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>

Closes GH-874
  • Loading branch information
JounQin authored Oct 13, 2021
1 parent d0d6f29 commit a0ef353
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/remark-stringify/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @typedef {import('mdast').Root|import('mdast').Content} Node
* @typedef {import('mdast-util-to-markdown').Options} Options
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownOptions
* @typedef {Omit<ToMarkdownOptions, 'extensions'>} Options
*/

import {toMarkdown} from 'mdast-util-to-markdown'
Expand All @@ -18,7 +19,10 @@ export default function remarkStringify(options) {
// Note: this option is not in the readme.
// The goal is for it to be set by plugins on `data` instead of being
// passed by users.
extensions: this.data('toMarkdownExtensions') || []
extensions:
/** @type {ToMarkdownOptions['extensions']} */ (
this.data('toMarkdownExtensions')
) || []
})
)
}
Expand Down

0 comments on commit a0ef353

Please sign in to comment.