contentlayerdev / contentlayer

Contentlayer turns your content into data - making it super easy to import MD(X) and CMS content in your app
https://www.contentlayer.dev
MIT License
3.31k stars 201 forks source link

TS error for self-referencing type definitions #4

Open schickling opened 3 years ago

schickling commented 3 years ago

image

'Link' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.

Workaround: Use any

image

cc @seancdavis

schickling commented 2 years ago

One further idea how to solve it: Special "string rule" for self-recursive definitions:

image
seancdavis commented 2 years ago

@schickling I think that would be a reasonable approach, as long as that's how of behaved in non-recursive scenarios. Otherwise we're asking developers to use of in two different ways, and that could be confusing.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.