Skip to content

How to type a custom plugin on project? #747

Answered by ChristianMurphy
SalahAdDin asked this question in Q&A
Discussion options

You must be logged in to vote

@SalahAdDin can you share a repeatable example?
Trying what you shared in a simplified codesandbox, the typing appears to work.

https://codesandbox.io/s/youthful-hofstadter-qtojl?file=/src/App.tsx

A number of things to check for:

  1. see what typescript version you are using (the sandbox is using 4.1.3, https://codesandbox.io/s/youthful-hofstadter-qtojl?file=/package.json:529-550)
  2. check what settings you have in your tsconfig.json (the sandbox is using https://codesandbox.io/s/youthful-hofstadter-qtojl?file=/tsconfig.json)
  3. try removing some of the abstractions you added around the types, see if that resolves it

Also note, that mdast has typings for the image node which can be used to simpli…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@SalahAdDin
Comment options

@ChristianMurphy
Comment options

@ChristianMurphy
Comment options

Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
☂️ area/types This affects typings
2 participants