-
Notifications
You must be signed in to change notification settings - Fork 14
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
Type hints seem to be incorrect #29
Comments
At least please provide remark packages versions, TypeScript version, your tsconfig. remark bumped major version last month. It may affect on type definitions. |
Sure
I use
The full The type expected by Astro is: export type RemarkPlugin<PluginParameters extends any[] = any[]> = unified.Plugin<
PluginParameters,
mdast.Root
>;
export type RemarkPlugins = (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[]; Problem occurs when passing |
Could you share the exact version of remark-emoji package in your local? If okay, it is helpful to dump all the dependendcies by |
remark-emoji 4.0.0 Here is the output of |
I improved type definitions in this package and released v4.0.1. Could you try the latest version? |
hey hey @rhysd! (using |
I still have the same problem: I checked one of the official plugins how they are using types, and it turns out that there might be some problem with TypeScript and remark types in general. This seems relevant: Maybe @wooorm would know more? |
The types are fine. The problem is that there are different types (because mismatched dependencies). And that’s how TypeScript works: adding one field in a type somewhere is breaking. Which is why I did breaking changes everywhere. The solution is to update all your tools, not just some. This is how TS works, it warns when things might not work. You can add a
Nope, that’s a solution to a bug with how TS generates |
Reading through the types in |
It seems the problem isn't here then, nevertheless thanks and sorry for bugging you 😅 |
I missed this conversation since this issue was closed. @wooorm Thank you for your follow up. |
@rhysd I'm using remark-emoji with contentlayer.
I would appreciate any advice on how to resolve this issue. |
|
@wooorm P.S. |
When trying to use this plugin in Astro 3.4 I see the following TypeScript error:
Astro expects an array of the following type:
https://github.com/withastro/astro/blob/5fed432b0c3c84542a3d1b2952d183e9cbe3fa0e/packages/markdown/remark/src/types.ts#L28
This plugin does work correct however.
The text was updated successfully, but these errors were encountered: