Skip to content

Help needed on how to type custom rehype plugin #204

Answered by wooorm
jnahumphreys asked this question in Q&A
Discussion options

You must be logged in to vote
  1. plugins use default exports, not named exports: export default function rehypeListHeadings
  2. your suspicion is right, the type of your plugin is import('unified').Plugin<void[], Root>
  3. If you had options, the type would be import('unified').Plugin<[Options?], Root>

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@jnahumphreys
Comment options

@wooorm
Comment options

@jnahumphreys
Comment options

@remcohaszing
Comment options

@jnahumphreys
Comment options

Answer selected by jnahumphreys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants