X Tutup
The Wayback Machine - https://web.archive.org/web/20220323002114/https://github.com/unifiedjs/unified/discussions/155
Skip to content

does unified@10 intentionally disallow `Promise<void>` as plugin return type? #155

Answered by wooorm
stefanprobst asked this question in Q&A
does unified@10 intentionally disallow `Promise<void>` as plugin return type? #155
Jul 21, 2021 · 1 answer

it looks like the new unified version enforces Promise<undefined> vs Promise<void> as async plugin return type - just wanted to ask if this is intentional?

import {unified} from 'unified'

const processor = unified().use(() => {
  return transformer
  async function transformer() {
    // noop
    return undefined // <-- required
  }
})

Good catch. Landed: 591b0c0. And released!

Replies

1 suggested answer

wooorm
Jul 21, 2021
Maintainer

Good catch. Landed: 591b0c0. And released!

0 replies
Answer selected by wooorm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
☂️ area/types
2 participants
X Tutup