Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mismatch types for markdown-it #228

Merged
merged 2 commits into from
Jun 1, 2024
Merged

fix: mismatch types for markdown-it #228

merged 2 commits into from
Jun 1, 2024

Conversation

nekomeowww
Copy link
Member

Fix issue for:

No overload matches this call.
  Overload 1 of 3, '(plugin: PluginSimple): MarkdownIt', gave the following error.
    Argument of type 'PluginWithOptions<{ tag: string; } | null | undefined>' is not assignable to parameter of type 'PluginSimple'.
      Types of parameters 'md' and 'md' are incompatible.
        Type 'MarkdownIt' is not assignable to type 'markdownit'.
  Overload 2 of 3, '(plugin: PluginWithOptions<{ tag: string; } | null>, options?: { tag: string; } | null | undefined): MarkdownIt', gave the following error.
    Argument of type 'PluginWithOptions<{ tag: string; } | null | undefined>' is not assignable to parameter of type 'PluginWithOptions<{ tag: string; } | null>'.
      Types of parameters 'md' and 'md' are incompatible.
        Type 'MarkdownIt' is not assignable to type 'markdownit'.
  Overload 3 of 3, '(plugin: PluginWithParams, ...params: any[]): MarkdownIt', gave the following error.
    Argument of type 'PluginWithOptions<{ tag: string; } | null | undefined>' is not assignable to parameter of type 'PluginWithParams'.
      Types of parameters 'md' and 'md' are incompatible.
        Type 'MarkdownIt' is not assignable to type 'markdownit'.ts(2769)
No overload matches this call.
  Overload 1 of 3, '(plugin: PluginSimple): MarkdownIt', gave the following error.
    Argument of type 'PluginWithOptions<{ tag: string; } | null | undefined>' is not assignable to parameter of type 'PluginSimple'.
      Types of parameters 'md' and 'md' are incompatible.
        Type 'MarkdownIt' is not assignable to type 'import("/Users/neko/Git/nolebase/integrations/node_modules/.pnpm/@[email protected]/node_modules/@types/markdown-it/lib/index").default'.
  Overload 2 of 3, '(plugin: PluginWithOptions<{ tag: string; } | null>, options?: { tag: string; } | null | undefined): MarkdownIt', gave the following error.
    Argument of type 'PluginWithOptions<{ tag: string; } | null | undefined>' is not assignable to parameter of type 'PluginWithOptions<{ tag: string; } | null>'.
      Types of parameters 'md' and 'md' are incompatible.
        Type 'MarkdownIt' is not assignable to type 'import("/Users/neko/Git/nolebase/integrations/node_modules/.pnpm/@[email protected]/node_modules/@types/markdown-it/lib/index").default'.
  Overload 3 of 3, '(plugin: PluginWithParams, ...params: any[]): MarkdownIt', gave the following error.
    Argument of type 'PluginWithOptions<{ tag: string; } | null | undefined>' is not assignable to parameter of type 'PluginWithParams'.
      Types of parameters 'md' and 'md' are incompatible.
        Type 'MarkdownIt' is not assignable to type 'import("/Users/neko/Git/nolebase/integrations/node_modules/.pnpm/@[email protected]/node_modules/@types/markdown-it/lib/index").default'.ts(2769)

Related to

The mismatched incompatible types for @types/markdown-it@v14 has been fixed for internal plugins, but the MarkdownIt types that come from VitePress are still seems broken, will now treat as // @ts-expect-error temporarily.

@nekomeowww nekomeowww added bug Something isn't working upstream Blocked by or related to upstream dependencies labels Jun 1, 2024
@nekomeowww nekomeowww self-assigned this Jun 1, 2024
Signed-off-by: Neko Ayaka <[email protected]>
Copy link

github-actions bot commented Jun 1, 2024

✅ Successfully deployed to Netlify

Platform Status URL
Ubuntu Success https://665b307c82d8efbaad759cd8--nolebase-integrations.netlify.app
Windows Success https://665b308782d8efba9a759cb8--nolebase-integrations.netlify.app

@nekomeowww nekomeowww merged commit 0df3fd8 into main Jun 1, 2024
6 checks passed
@nekomeowww nekomeowww deleted the dev/fix-types branch June 1, 2024 14:36
@nekomeowww nekomeowww added pkg/thumbnail-hash Related to @nolebase/vitepress-plugin-thumbnail-hash pkg/git-changelog Related to @nolebase/vitepress-plugin-git-changelog pkg/page-properties Related to @nolebase/vitepress-plugin-page-properties pkg/inline-link-preview Related to @nolebase/vitepress-plugin-inline-link-preview labels Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg/git-changelog Related to @nolebase/vitepress-plugin-git-changelog pkg/inline-link-preview Related to @nolebase/vitepress-plugin-inline-link-preview pkg/page-properties Related to @nolebase/vitepress-plugin-page-properties pkg/thumbnail-hash Related to @nolebase/vitepress-plugin-thumbnail-hash upstream Blocked by or related to upstream dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant