TypeScript type issues after upgrading to unified v11 #1214
-
Hi there, I'm trying to upgrade unified to v11 (along with a bunch of related dependencies) in Typist (relevant PR), but I'm having a few issues with TypeScript types. You can see everything that went wrong in this GitHub action run, but I'll give a few examples below. Custom plugin issueI have no need for all that the import {
gfmStrikethroughFromMarkdown,
gfmStrikethroughToMarkdown,
} from 'mdast-util-gfm-strikethrough'
import { gfmStrikethrough } from 'micromark-extension-gfm-strikethrough'
import type { Options } from 'micromark-extension-gfm-strikethrough'
import type { Processor } from 'unified'
/**
* A remark plugin to add support for the strikethrough extension from the GitHub Flavored Markdown
* (GFM) specification.
*
* This is an standalone plugin which makes use of both the `mdast-util-gfm-strikethrough` and
* `micromark-extension-gfm-strikethrough` packages, and the implementation is inspired by the
* third-party `remark-gfm` plugin.
*
* The reason why we don't use `remark-gfm` directly is because we don't want to support all other
* GFM features (footnotes, tables, tagfilter, and tasklists).
*
* @param options Configuration options for the plugin.
*/
function remarkStrikethrough(this: Processor, options: Options = {}) {
const data = this.data()
function add(field: string, value: unknown) {
const list = (data[field] ? data[field] : (data[field] = [])) as unknown[]
list.push(value)
}
add('micromarkExtensions', gfmStrikethrough(options))
add('fromMarkdownExtensions', gfmStrikethroughFromMarkdown())
add('toMarkdownExtensions', gfmStrikethroughToMarkdown())
}
export { remarkStrikethrough } Here's the issue I'm having: Third-party plugins issueI'm initializing const unifiedProcessor = unified().use(remarkParse) And as you can see, I'm using the There's a bunch of similar errors for other third-party plugins. Actually, every single third-party plugin used in this file is showing the same error. In this case, I'm not doing anything fancy and/or out of the ordinary, I'm simply using the plugin, but it seems incompatible with unified v11. Please advise on how to proceed for both these issues. Much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey: downgrade. All projects will be updated. It’s 700+ packages, which takes time. Or |
Beta Was this translation helpful? Give feedback.
-
Welcome @rfgamaral! |
Beta Was this translation helpful? Give feedback.
Welcome @rfgamaral!
Thanks for your excitement and interest trying out the latest version.
Echoing @wooorm,
unified
11 support is making it's way through all the projects, and has not yet made it to theremark
projects, it will in the coming weeks.For now, hold the
unified
version to 10, and keep an eye out for new major versions ofremark
plugins which will supportunified
11 and include other helpful fixes and features.